It work well in chrome and IE but for some reason Firefox still sends the emails even though the php prompts the user to complete all required fields.
I am wanting to use ajax as a real time solution to making sure all fields are entered.
See the article Web Services using XMLHttp Request (Ajax) for details on all avaiable commands and their parameters.
For assistance in generating a valid XML response using PHP, read the article Generating an XML Response for Ajax Applications where you'll find a PHP class that complements the preceding Java Script functions.
In this case it'ss a PHP file, but another server-side scripting language would work just as well.
The validation script returns XML data which is then processed and applied to the form to provide feedback to the user.
The to the input box ('email'), to the associated checkbox ('valid_email) and to the DIV where the feedback text is to appear ('rsp_email').
These elements can then be referenced in the XML file that is returned by the Ajax call.
The on Submit handler for the form requires also that a value be entered in all fields before the form can be submitted.
I have searched the site but can't find a link to a download page. I have been working on a webmail form that uses php.
there are radio buttons and check buttons on the site as well as fields that must be completed.
The 'empty comment" in the DIV is just a place-holder - required in some older browsers when a DIV is empty, but needs later to be referenced by a script.
When we call the function we pass three parameters: the method (in this case 'check Email' or 'check Age') to use for testing, the value to test, and the id of the input field (target).