Ajax is good for validating specific things that would be too much to send in the initial document. Like for a checkbox it would be best to use a server side to throw in a variable that you would use to ensure the form is filled out correctly.
- form.onsubmit = function ()
-
{
-
return (window.getElementById ("tosagreed").checked == (true))
-
}
Ajax would be good for (these are examples)...
- Checking that a username isn't already taken.
- Getting a long list of cities/provinces and sticking them into a drop down box when a user picks a specific country/state.
- Getting a list of online people on a page that is not meant to be refreshed (like a chat room).
- Saving stuff to the server you are actively editing (take a look at Google Documents, and Spreadsheets) so that you don't lose any information if your browser crashes.
Ajax isn't really the best choice for some of the things that sForm uses it for. Email validation, for example, can be done without using Ajax at all. With or without Ajax, though, you should always use server-side verification for everything no matter what. Because if it's client-side, they can get around it. The purpose of Ajax is to let users know that they are good to go before they submit, knowing they probably wont get a, "you filled the form out wrong!"