As ravenpl points out, javascript validation works the best for simple validation and if that's all you need, go that way.
If you have checking that really has to be performed on the server side (check a database or something), your php code could perform the checking at the top and, if things are OK, branch to an "include('crunch.php');" which would give crunch.php access to all the form result variables. The else side of your branch would then redisplay the form with the fields highlighted (and the fields that were OK filled in with the values you received).
Main Topics
Browse All Topics





by: ravenplPosted on 2005-10-15 at 06:46:37ID: 15091237
The default action for FORM tak is self. You can change it with javascript code
= 'http://myserver.tld/myscr ipt.php'
document.myFormname.action
do it, if javascript validation function fails.