We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27223
    • 2 Posts
    My Problem: I’ve created a easy form and want to validate it with eForm, but there was a little deviation: In my Contact Form is a Selectbox-Element. The option’s are generated by a snippet. To explain it better - the Source Code of my ContactForm-Chunk:
    <select name="subject" id="cfBetreff" eform="Betreff::1">
    [[Snippet]]
    </select>
    

    after loading the ContactForm, the options are printed and where displayed:

    <select name="subject" id="cfBetreff" eform="Betreff::1">
    <option value="1">Redaktion</option>
    <option value="2">Kritik</option>
    <option value="3">Anzeigen</option>
    </select>
    


    But the validation fails everytime after validating the selectField called "subject" with: "Incorrect value". After many tries I think the Problem is that eForm parses the Form before the snippet is printing the options. So I change the following line in the eForm Snippet:
    tpl => isset($tpl)? $tpl:$modx->runSnippet('contact'),
    

    So the snippet "contact" prints the whole ContaktFormular and now the validation passes successfull (when Values are valid)

    Is it a generell problem that a snippet can’t loaded in the Template Chunk wich is used in eForm? And is my solution the only one?
      • 30223
      • 1,010 Posts