Results 1 to 2 of 2

Thread: Using required for select dropdowns?

  1. #1
    Join Date
    Feb 2006
    Posts
    1

    Default Using required for select dropdowns?

    I'm pretty new at FormMail.

    I've been using the "required" option for various fields in my form, and it's working fine, except I can't figure out how to use it for a select dropdown menu.

    In my form, to register for a class, I have two dropdowns, one called "firstchoice" and the other called "alternate". In other words, I want people to choose a class, and choose an alternate.

    On the form, my select elements look like this:
    Code:
    <select name="firstchoice[]">
            <option value="100">100-Basket Weaving</option>
            <option value="200">200-Tying Knots</option>
            <opton value="300">300-Flower Arranging</option>
            </select>
     
            <select name="alternate[]">
            <option value="100">100-Basket Weaving</option>
            <option value="200">200-Tying Knots</option>
            <opton value="300">300-Flower Arranging</option>
            </select>
    How can I write a required option to be sure that they have picked a "first choice" and they have picked an "alternate" and that the first choice and alternate are two different things?

    I tried:

    Code:
    <input name="required" value="firstchoice[]!=alternate[]" type="hidden">
    But it doesn't seem to work. Thanks for any tips.

  2. #2
    Join Date
    Jul 2005
    Posts
    175

    Default Re: Using required for select dropdowns?

    Hi,

    delete the "[]"
    try
    Code:
            <select name="firstchoice">
            <option value="" selected="selected">Please Choose a Class</option>
            <option value="100">100-Basket Weaving</option>
            <option value="200">200-Tying Knots</option>
            <opton value="300">300-Flower Arranging</option>
            </select>
     
            <select name="alternate">
            <option value="" selected="selected">Please Choose an Alternate</option>
            <option value="100">100-Basket Weaving</option>
            <option value="200">200-Tying Knots</option>
            <opton value="300">300-Flower Arranging</option>
            </select>
    Code:
    <input type="hidden" name="required" value="firstchoice, alternate" />
    or have look at http://tectite.com/vbforums/showthread.php?t=780

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. required fields
    By darren777 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 04-Mar-2005, 09:37 AM
  2. Required fields containing default text
    By tvulucy in forum FormMail Subscription Support
    Replies: 9
    Last Post: 08-Oct-2004, 09:26 PM
  3. Required Fields not working?
    By zoe77 in forum FormMail Subscription Support
    Replies: 2
    Last Post: 02-Jun-2004, 04:27 PM
  4. required field error
    By Ibis in forum FormMail Subscription Support
    Replies: 18
    Last Post: 02-Mar-2004, 09:04 AM
  5. required does not work ?!
    By flynst4r in forum FormMail Subscription Support
    Replies: 9
    Last Post: 26-Jan-2004, 09:04 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •