Text Box required input?

B

Bill

I have a series of two number text boxes. I set conditions for the numerical
entry (between 08 and 27) but did not check the REQUIRED box in the
validation area. However, it appears that event though entry is not
required, the conditions still must be met. How can I allow someone to not
use one of the boxes. The form is calling for users to fill in the years of
their cars and I provided 4 opportunities. However, many users will have
only one, two or three cars so it is likely that at least one box will not
be used and therefore remain empty.

Thanks, Bill
 
I

Ian Haynes

I have a series of two number text boxes. I set conditions for the
numerical entry (between 08 and 27) but did not check the REQUIRED box in
the validation area. However, it appears that event though entry is not
required, the conditions still must be met. How can I allow someone to not
use one of the boxes. The form is calling for users to fill in the years
of their cars and I provided 4 opportunities. However, many users will
have only one, two or three cars so it is likely that at least one box will
not be used and therefore remain empty.

If you want to ensure numeric entry but don't want force an entry, why not
replace them with drop down boxes prepopulated from 8 to 27 (or 0 to 27). An
easier solution?

HTH
 
R

Ronx

One solution is to use a dropdown select boxes instead of a text boxes:

<select name="yearFirst">
<option>Not Applicable</option>
<option>08</option>
....
<option>28</option>
</select>

Use Javascript to determine whether the Not Applicable should be used or
not, dependant on other fields associated with the select box.

For a different solution, take a look at
http://www.rxs-enterprises.org/tests/pages/car_registrations.html

This solution sets all the fields to default values, and hides the
sections that will not be used - example the section for the 4th car
will be hidden if the user has only 3 cars.
 
B

Bill

If you have the patience, one more question. I am attempting to insert this
code into an existing FP 2003 page. I continue to get an error message for
line 91 which is "for (ii=1; ii<=4; ii++) {"

This occurs when I attempt to select 2 or more cars.
It could be my insertion method..i.e. I am not putting all the elements in
the right place. I am not as smart about inserting code as I will be later.
Again, thanks for the solution.
Bill
 
R

Ronx

The example on my site works in IE7 and FireFox without problems - in
both cars.html and car_registrations.html.

JavaScript errors count lines from 0 - is the snippet you quote really
line 91, or the line after that? In fact the lines before and after this
are more likely to error.

Have you named your form "vehicleRegistration"?

Have you added FrontPage validation to any form elements? If you have
then FrontPage will rename the form to FrontPage_form1 or similar. In
this case look for vehicleRegistration in the code, and replace it with
FrontPage_form1 (or whatever FP renamed your form to). Note that cAse
is important. I forgot this step since I don't use FrontPage
validation.

It would help if you gave a link to your page, or posted the code here.
 
B

Bill

Thanks for the response. I have not renamed the form, however as I noted,
I am attempting to add it to an existing form. I agree it would be much
more efficient if you can see what the project looks like without changes,
just a simple copy to the code. I am using the clean code.
http://home.triad.rr.com/apply/census.htm

Thanks again for your help.
Bill
 
B

Bill

Thanks a million ! I will go through and compare with what I have to
determine the differences. Your effort is much appreciated and I will not
be taking any more of your time.
Have a great holiday.

Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top