Forum Moderators: open

Message Too Old, No Replies

One item from "drop down" menu required

How do I make this required?

         

bartainer

11:00 pm on Oct 5, 2005 (gmt 0)

10+ Year Member



Hello;

I'm not sure how to make at least one item from the drop down menu a required selection? Please help!

Thanks.

bartainer

11:07 pm on Oct 5, 2005 (gmt 0)

10+ Year Member



Hello;

I'm sorry, this is a list menu and I'm using DW 8 to create this drop down list. It's not a drop down menu (navigation).

Thanks.

garann

12:00 am on Oct 6, 2005 (gmt 0)

10+ Year Member



It's hard to know what the best approach is without seeing your code, but something like this might work:


<script type="text/javascript>
function doValidate(frm) {
if (document.getElementById("dropDown").value!= "")
frm.submit();
}
</script>
...
<form name="myForm" action="next.html" onsubmit="return false;">
<select id="dropDown">
<option value="A">A</option>
...
</select>
<input type="button" onclick="doValidate(this.form)"/>
</form>

(That's totally untested, mind you.)