I am creating a simple form. I would like to use embedded javascript to validate that the form is filled out and then, if it turns out to be valid, process the data with a php script.
I don't know how to do this, because I don't know how to associate more then 1 script with a form.
<form id="aform" name="aform" action="myvalidationscript.js" method="POST" onSubmit="return checkForm()">
will get my form validated and only send the date if it is valid, but how do I get it to understand that there is a PHP file on the server that wants to accept the data and do something with it?
Either this is possible and I don't know how to do it, or I have the model for validation all wrong. I recognize that I could do the validation in the same PHP file as the processing, but I would like 1) the option to organize my code by functionality a little better than putting everything in one script, and 2) the option to validate client-side with some embedded javascript.
Any suggestions?