02-12-2004, 12:40 PM
02-12-2004, 12:50 PM
java script is client based, meaning that after u submit a form it don't exist really.
so there are 2 solutions
write the checks in php
02-12-2004, 12:58 PM
02-12-2004, 01:37 PM
something like this, but am sure we have some better form validation peps around lol :)
<form name="test" action="test.php">
<input type="Submit" value="test" onclick="validate(this);return false;">
02-12-2004, 01:40 PM
I think I'm getting confused with all this because the page (edit_details.php) with the form is self - submitting i.e. if all the details entered are ok then the edit_details.php prints a summary, if not it outputs the form again. Its probably easier to view the code to see what i mean!
02-12-2004, 07:28 PM
The the submit button just needs to include the onClick like Garadon has shown.
Alternatively, you can have an attribute in the form tag called onSubmit calling your functions. Your function will have to return true to submit (valid) or false to not submit.
Hope that helps,