Skip to main content
Known Participant
March 6, 2007
질문

List/Menu a required field

  • March 6, 2007
  • 3 답변들
  • 497 조회
Is there a way to make a list/menu field in a form required by the user to select an item from its list? I know how to do it for a text field but not for a list menu.

Thanks,
Dave
이 주제는 답변이 닫혔습니다.

3 답변

Dave_Blake작성자
Known Participant
March 7, 2007
Thanks for the input. I will download the extension and give that a try!!

Dave
Participating Frequently
March 7, 2007
I am assuming you want client side validation.

if( document.form1.listMenuID.options[document.form1.listMenuID.selectedIndex].value == "" )
alert("Please select your list menu");

You can also simply test the selectedIndex value, assuming the first item in the list menu is the "not selected" value.

if( document.form1.listMenuID.selectedIndex == 0)
alert("Please select your list menu");
Inspiring
March 7, 2007
Download the Check Form extension from www.yaromat.com as it has an option
to force the person to select from a drop down and exclude the first item.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Dave Blake" <webforumsuser@macromedia.com> wrote in message
news:esk17i$1aj$1@forums.macromedia.com...
> Is there a way to make a list/menu field in a form required by the user to
> select an item from its list? I know how to do it for a text field but
> not for a list menu.
>
> Thanks,
> Dave