Forum Moderators: mack
For example, I'd like to pop up an error message if somebody tries to tick a check box without first entering data in a separate text box.
I'd also like to do the same thing after a user has entered data into a text box, and 'moved away' to another field.
I want to do it this way because I've got a table with multiple rows of data, and generating error messages 'after the event' would be pretty clunky.
All the info. on client-side validation I've found still seems to use an 'after submitting' model (although the validation is of course done by the client, not the server)
AJAX seems to do something close (i.e. underlining a mis-spelled word on Jacuba.com), but I don't need to refer to data on the server to do the validation.
I've been hunting high and low on the web to try and find some examples of this (i.e. to prove it is in fact possible) but I just can't find anything.
Even if you can only point me to a web-site that does this, any help would be much appreciated!
However, do NOT depend on this as security or to insure data integrity. It is only a convenience for the user, letting them know sooner that they've provided invalid data.
You MUST perform the same checks again server-side, because some users will not have Javascript enabled, and also because client-side Javascript is not secure.