Forms - Drop-down Box

J

Joe Miller

I am creating a form with a drop-down box that I want to
make a required field. Rather than having the first
option display in the form by default, I want "Choose One"
to display. Of course "Choose One" cannot be submitted as
an option. How can I make the field required and have the
first item in the drop-down box display "Choose One"?
Thanks in advance.
 
J

Jon Spivey

Hi Joe,
Have you got any other FP validation going on this page? If not you'd just
do something like this
<script type="text/javascript">
function checkForm(f){
if(f.SelectBox.selectedIndex==0){
alert('Please Choose An Option');
return false;}
return true;}
</script>
<form onsubmit="return checkForm(this);"....
<select name="SelectBox">
<option value="">Choose One</option</option>

If you've got other validation post back with a url to the page
 
T

Thomas A. Rowe

Enter "Choose One" as the first option, then click Validation and set disallow first option.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, WebCircle, MS KB Quick Links, etc.
==============================================
 

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