Solved

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

Posted on 2006-06-25
1
163 Views
Last Modified: 2010-04-09
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
Comment
Question by:starview
1 Comment
 
LVL 36

Accepted Solution

by:
Zyloch earned 500 total points
ID: 16979471
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now