Hello,
I want to validate form fields with JavaScript. This is easy - I can just take some standard scripts off the net that do this.
The problem is that my form keeps submitting even when verification is needed.
So for example, if I leave the name field empty and press submit, it will bring up the alert box saying to enter a name then it will submit a record to the database anyway.
Then the customer fills in the details correctly and submits properly so there are 2 entries.
I have tried putting the verification function in the submit button and the form tag as an onClick but it doesn't work.
The form tag is:
Code:
<form name="theForm" method="post" action="Register" id="Register">
Basically the 'action' above activates when submit is clicked even when there is verification needed.
What can be done about this?
Thanks.