We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30741
    • 65 Posts
    I am trying to get an appointment form to work, but the select box keeps pulling up a validation issue (even thought I don’t want validation at all on the select boxes) So I can’t turn off validation nor can I get it to validate anything at all.

    Can someone help me here, I saw a few posts on this subject but nothing seems to be working.

    Thanks!!
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Have you tried this?
      <select name="blah" eform="::0::">
      ...
      </select>
      

      I got such an error when I had moved the first input element (the one with the eform attribute) in a group of checkboxes below the group reporting the error. Apparently it was validating all "checkbox" elements until the next eform attribute, and since they didn’t belong to the same "name[]" group it caused that error; moving the eform attribute to the first input element of the actual offending group fixed it.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 26016
        • 561 Posts
        Susan’s probably onto something. It’s hard to see without seeing the call and template.

        Basically your HTML code looks OK. The only thing that’s off to me is that you have
        id="cfMonth"

        on so many SELECT elements, and I wonder if that could be bollixing something.

        Some time ago I found that there was one kind of eForm field I could never get to validate at all, I can’t remember now, it may have been checkboxes or radio buttons.

        I’ve been through form hell this week, so I sympathize with you. Coding forms has the deadly combination of being tricky AND extremely boring, so I’m following the form generation research here with fervor.

        Dave
          MODx and Wordpress development
          Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          I’ve just finished a form with a whole bunch of checkboxes and radio buttons with no problems (that I didn’t cause myself).
          For both, the first one has the eform attribute.
          <input class="checkbox" name="box[]" type="checkbox" value="Blah" eform="Title::1" /> Blah
          <input class="checkbox" name="box[]" type="checkbox" value="Foo" /> Foo
          <input class="checkbox" name="box[]" type="checkbox" value="Baz" /> Baz
          

          The name must have the [] because there can be more than one selected, and it gets put into an array.
          <input class="radio" type="radio" name="pre" value="Miss" eform="Pre::1" > Miss 
          <input class="radio" type="radio" name="pre" value="Mrs"> Mrs
          <input class="radio" type="radio" name="pre" value="Ms"> Ms
          <input class="radio" type="radio" name="pre" value="Mr"> Mr
          

          Notice no [] here.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 30741
            • 65 Posts
            Thanks for the help but, still no go - the 2nd set of selection boxes work, but not the first or third. I did try and change the ID as suggested, and even eliminated some select boxes but I just don’t get it.

            Here is my eform call -
            [!eForm? &formid=`AppointmentRequest` &subject=`[+subject+]` &to=`[(emailsender)]` &ccsender=`1` &tpl=`AppointmentForm` &report=`AppointmentFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`46` !]
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              More to the point would be your AppointmentForm template.
                Studying MODX in the desert - http://sottwell.com
                Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                Join the Slack Community - http://modx.org
                • 30741
                • 65 Posts
                Its attached in the first post. Or am I missing something?
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  No,it’s just nearly 1 AM here and I really should get off the computer and get some sleep.
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    You really should try running this through the W3C validator and getting it cleaned up.

                    Another thing is that your form’s ID attribute should match the snippet’s &formid parameter. eForm doesn’t need the hidden field any more (actually it generates its own hidden field based on the form tag’s ID attribute; I’m not sure what the results of conflicting values like that does to it).
                      Studying MODX in the desert - http://sottwell.com
                      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                      Join the Slack Community - http://modx.org