PHP and JavaScript Form Help
Posted by: Joseph Witchard
Posted on: 2008-07-01 08:20:00
So, I've got an email form that uses PHP to process it. I also have JavaScript ready to catch invalid fields as well as PHP script. However, using JavaScript, when someone makes an error, an alert window pops up. After you click OK in the alert, though, the PHP still sends the form, which then results in PHP also telling the user that their input is invalid.
Is there any way to cancel the $_POST array with JavaScript like you do with PHP code? I've never used JavaScript and PHP together before this, so I wouldn't know.