We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 5529
    • 70 Posts
    So I’ve set up a Meeting Registration page where the admin can add dates via template variables. These, in turn, form the options of a select list for the page the end user sees. He/she can then select a meeting and register. However, when submitted, eForm throws an error flagging the select list as invalid no matter which option is selected. I found that if I hard code the options with dates rather than TV’s then it works fine. It’s only when TV’s are used the problem occurs. And the TV’s appear fine on the screen. Hypothesis: eForm is caching the unparsed placeholders of the TV’s and comparing them with the posted values (after the TV’s are parsed) and since the data don’t match, throws an error. Is this true? And what are my options? (I’ve tried using eform_options="Date::1" and that doesn’t work either.)

    Thanks so much!
      • 30223
      • 1,010 Posts
      Yep, that sums it up quite nicely. eForm is invoked BEFORE the tv’s are evaluated and thus compares posted values to something entirely different.

      What you need to do is to use eForm’s eFormOnBeforeFormsParse event to set the option values yourself. Something similar has been discussed before in the forums although I couldn’t find it myself just now smiley
        • 5529
        • 70 Posts
        Quote from: TobyL at Jan 25, 2008, 01:09 AM

        Yep, that sums it up quite nicely. eForm is invoked BEFORE the tv’s are evaluated and thus compares posted values to something entirely different.

        What you need to do is to use eForm’s eFormOnBeforeFormsParse event to set the option values yourself. Something similar has been discussed before in the forums although I couldn’t find it myself just now smiley

        That being the case, I’m going to need some help because there’s only 3 lines in the docs for eForm on this event. So can you walk me through creating a function or point me toward some doc that explains how to do it? The meeting dates (the form is for meeting registration) will constantly change and the client will be inputing them, so tv’s are the natural solution. So whatever the solution, it will have to incorporate the tv’s or something an ordinary user can change through the TinyMCE editor.

        OR...even better....

        Is there way to shut off validation for the fields with template variables? This form is in a members-only area. I’m not worried about security.
        If not, the help detailed above would be greatly appreciated!
          • 30223
          • 1,010 Posts
          Have a look here: http://modxcms.com/forums/index.php/topic,22072.msg136074.html#msg136074

          That should give you enough info to get you going. If not, hire me... smiley
            • 5529
            • 70 Posts
            Quote from: TobyL at Jan 25, 2008, 10:06 PM

            Have a look here: http://modxcms.com/forums/index.php/topic,22072.msg136074.html#msg136074

            That should give you enough info to get you going. If not, hire me... smiley

            SOLVED! See the linked thread above for important notes/updates to the suggested code therein.