02-12-2004, 11:40 AM
02-12-2004, 11:50 AM
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, 11:58 AM
02-12-2004, 12: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, 12: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, 06: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,