Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

List/Menu a required field

New Here ,
Mar 06, 2007 Mar 06, 2007
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
TOPICS
Server side applications
497
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 06, 2007 Mar 06, 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


Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 07, 2007 Mar 07, 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");
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 07, 2007 Mar 07, 2007
LATEST
Thanks for the input. I will download the extension and give that a try!!

Dave
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines