A Spry Validation widget is a field that displays valid or invalid states when the user enters text. For example, you can add a Validation Text Field widget to a form in which is a required field or that is. If the user does not enter the correct information into the field (or no information at all) the widget will return a message stating that the information is either incorrect or is missing.
Check it out...
If you haven't downloaded the Spry framwork yet you can download it Here
The form validation is fairly easy to set up. All you need is your Spry include files that are downloaded with the framework.
Here is an example of a textbox for Spry
The textfieldRequiredMSG on submit will check to see if the information was entered if not it will come up with an error Please enter your First Name. This is great for me that means I don't have to add a lot of extra code to display what the error is etc. (I like to keep my code as simple as possible...a lot less work for me)
You will then reference your div id in the script block
You can view the full code here