We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 16899
    • 284 Posts
    Hi All

    I really need help on this subject!!! The error message don´t shows up on the select box.

    I´ve followed instructions here http://rtfm.modx.com/display/ADDON/FormIt.Handling+Selects%2C+Checkboxes+and+Radios, but i have no idea what´s going wrong! I

    Does anybody knows how to help me????

    FormIT call:
    [[!FormIt?
       &hooks=`spam,email,redirect`
       &emailTpl=`events-form-email`
       &emailFrom=`[email protected]`
       &emailSubject=`Subject`
       &emailTo=`[email protected]`
       &redirectTo=`31`
       &validate=`first-name:required,
          last-name:required,
          email:email:required,
          hear-about-us:required,
          event-type:required
    `]]


    HTML code
    <div class="field-wrapper-full">
    <label for="hear-about-us">Where did you hear about us?* <span class="error">[[!+fi.error.hear-about-us]]</span></label><br/>
    <select name="hear-about-us" value="[[!+fi.hear-about-us]]" class="curvyIgnore">
    <option value="Select an option...">Select an option...</option>
    <option value="Search Engine" [[!+fi.hear-about-us:FormItIsSelected=`Search Engine`]] >Search Engine</option>
    <option value="Social Media" [[!+fi.hear-about-us:FormItIsSelected=`Social Media`]] >Social Media (ie: Facebook, Twitter, etc)</option>
    <option value="Oceanico Websites" [[!+fi.hear-about-us:FormItIsSelected=`Oceanico Websites`]] >Oceanico Websites</option>
    <option value="Newsletter" [[!+fi.hear-about-us:FormItIsSelected=`Newsletter`]] >Newsletter</option>
    <option value="Newspaper" [[!+fi.hear-about-us:FormItIsSelected=`Newspaper`]] >Newspaper</option>
    <option value="Magazines" [[!+fi.hear-about-us:FormItIsSelected=`Magazines`]] >Magazines</option>
    </select>
    </div>


    Many thanks in advance!!!
      • 34183
      • 23 Posts
      For anyone else that my stumble upon this thread...

      Change the first select option in your HTML:
      <option value="" [[!+fi.hear-about-us:FormItIsSelected=``]]>Select an option...</option>


      Add this to your FormIt call inside the &validate section:
      hear-about-us:required:minLength=`1`


      By leaving the option value blank, you can validate it based on length.