We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37042
    • 384 Posts
    Can anyone help me solve a select box issue with formit ?
    I have 4 options in a drop down list / select box as follows

    - Select an option
    - One
    - Two
    - Three

    Choosing One, Two or Three should not throw an error but choosing
    "Select an option" should cause the field to fail validation.


    <label for ="numbers">Numbers:
       <span class="required">*</span>
       <span class="error">[[!+fi.error.numbers]]</span>
    </label>
    
    <select name="numbers" value="[[!+fi.numbers]]">
                <option value="">Select an option...</option>
                <option value="one" [[!+fi.numbers:FormItIsSelected=`one`]]>One</option>
                <option value="two" [[!+fi.numbers:FormItIsSelected=`two`]]>Two</option>
                <option value="three" [[!+fi.numbers:FormItIsSelected=`three`]]>Three</option>
    </select>
    


    Thanks
      ...
      • 40045
      • 534 Posts
      What's your &validate=`` stuff in the FormIt call? Maybe try to give it 0 instead of "" ?
        • 37042
        • 384 Posts
        Thanks exside. Will try that.
        My current &validate stuff is

        &validate=`
        firstname:required,
        surname:required,
        telephone:required,
        email:required,
        company:required,
        website:required,
        sector:required,
        stage:required,
        reg-office-address:required,
        town:required,
        reg-post-code:required,
        company-number:required,
        summary:required,
        numbers:required
        ` 
          ...
          • 28120
          • 380 Posts
          This works fine for me on a form I implemented this week.

          You're sure there's no space between the quotes in value=""

          i.e. value=" "