We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19872
    • 1,078 Posts
    Actually though, the Docs state that a placeholder should work. Maybe it's because you have a default selection in there. The example provided in my mind suggest that regardless of what is selected, for sure the email is going to go to [email protected] unless the user selects [email protected]

    However, in your case as in mine—the structure for the FormItIsSelected needs to be the alternate method to avoid the errors.

    Specifying a Dynamic To Address
    An example is using the form to specify who to send to:


    [[!FormIt?
    &emailTo=`[[+addressTo]]`
    ]]
    ...
    <select name="addressTo">
    <option value="[email protected]" [[!+fi.addressTo:FormItIsSelected=`[email protected]`]]>John</option>
    <option value="[email protected]" [[!+fi.addressTo:FormItIsSelected=`[email protected]`]]>Jane</option>
    </select>
      • 46039
      • 76 Posts
      Yeah, what I'm trying to do is pretty much just what the basic docs cover - sending a contact form to a person selected in the drop down list. I'm doing nothing weird or complex.
        • 19872
        • 1,078 Posts
        Yes. Sorry for circling back around to what you had already tried.

        Pretty much grasping at straws, but what about the location of the tic marks.

        You have:
        `[email protected],[[+addressTo]]`


        Perhaps tic marks need to surround each address separately? As in:
        `[email protected]`,`[[+addressTo]]`
          • 46039
          • 76 Posts
          I've only been putting the two addresses into the snippet call in order to check formit can actually send email – which it can.

          99% of the time I've just got:

          &emailTo=`[[+addressTo]]` 


          I've exhaustively gone through everything now – the next step would be repairing the MODX install, but I seriously doubt that will do anything.

          I'm starting to worry about MODX – I've had a few inexplicable issues like this. If switching from Drupal to MODX bites me in the ass at work I really won't be happy.
            • 19872
            • 1,078 Posts
            I don't know and can empathize. I'm pretty happy with MODx, but then I am not pushing the limits with it. The form situation however is well within bounds in my opinion though. Perhaps it's the combination of an actual email address AND a placeholder that is throwing it off. Perhaps you can private message the developer. I'm confident that the solution is much simpler than repairing an install.
              • 46039
              • 76 Posts
              OK well.. I've tested my markup and snippet call on 4 different installs of MODX and it doesn't work.

              Could somebody in the know please help me and tell me what I'm doing wrong here?

              Does FormIt work fully in recent versions of MODX? Does FormIt support form field placeholders within the snippet call?
                • 19872
                • 1,078 Posts
                Bummed to hear that you are stuck. I know only enough to be dangerous.

                Have you tried putting an empty select, so that neither address is selected?. Perhaps thats what is tripping up the placeholder.
                Also put the "[[!+fi.addressTo]]" on the <select> as well. Don't forget to use the alternate method for coding the FormItIsSelected parts.

                <select name="addressTo">value="[[!+fi.addressTo]]"
                <option value="" >Select Recipient</option>
                <option value="[email protected]" [[!+fi.addressTo:FormItIsSelected=`[email protected]`]]>John</option>
                <option value="[email protected]" [[!+fi.addressTo:FormItIsSelected=`[email protected]`]]>Jane</option>
                </select>
                  • 19872
                  • 1,078 Posts
                  STOP:

                  Actually move the greater that to the right of the formIt call.

                  <select name="addressTo" value="[[!+fi.addressTo]]">



                  "[[!+fi.addressTo]]" by being on the select is basically saying that "[[!+fi.addressTo]]" is one of the two option below — whichever one is selected. Right?
                    • 19872
                    • 1,078 Posts
                            <select name="addressTo" value="[[!+fi.addressTo]]">
                              <option value="">Choose Recipient</option>
                              <option value="[email protected]" [[!+fi.addressTo:is=`[email protected]`:then=`selected`]]>John</option>
                              <option value="[email protected]" [[!+fi.addressTo:is=`[email protected]`:then=`selected`]]>Jane</option>
                            </select>


                    if this does not work, perhaps try inserting mailto: though this is then really grasping at straws.

                          <select name="addressTo" value="[[!+fi.addressTo]]">
                              <option value="">Choose Recipient</option>
                              <option value="[email protected]" [[!+fi.addressTo:is=`mailto:[email protected]`:then=`selected`]]>John</option>
                              <option value="[email protected]" [[!+fi.addressTo:is=`mailto:[email protected]`:then=`selected`]]>Jane</option>
                            </select>
                      • 46039
                      • 76 Posts
                      Trust me it's all there - it has to be a deeper issue with FormIt. I'm starting to wonder whether it even supports field placeholders given that the docs are massively outdated and show broken code.

                      Do field placeholders work for you?