Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 171
  • Last Modified:

I have my form setup to check certain fields, to make sure they are filled.

I have my form setup to check certain fields to make sure they are field in and it seems to be working, But when it finds a field not filled in it will send an alert to fill in that information, but when you click out of the alert message it will try and send the form. It will not go back to the form to make corrections. Here is some of the form. It is alot bgger than this, but these are the key areas.

<TABLE width="100%" border=2>
  <TBODY>
  <TR>
    <TD width="100%">Name/Club Position:<input name="size91" type=text id="name-position" value="" size=132  MAXLENGTH=102></TD></TR>
  <TR>
    <TD width="100%">Street Address:<input name="size93" type=text id="street" value="" size=144  MAXLENGTH=104></TD></TR>
  <TR>
    <TD width="100%">City/Sate/Zip:<input name="size95" type=text id="state-zip" value="" size=139  MAXLENGTH=109></TD></TR>
  <TR>
    <TD width="100%">Phone Number with Area Code:<input name="size97" type=text id="phone" value="" size=120  MAXLENGTH=100></TD></TR>
  <TR>
    <TD width="100%">Email Address:<input name="size99" type=text  MAXLENGTH=108 size=138 value=""></TD></TR></TBODY></TABLE></CENTER></DIV>
<P align="center">
  <input type="Submit" value="Submit" onclick="verify();" />
0
starview
Asked:
starview
1 Solution
 
ZylochCommented:
Instead of putting it on onclick, you can do:

<form onsubmit="return verify();">

and make sure verify() returns false if there is an error and true otherwise.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now