We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20828
    • 6 Posts
    For example, I have two radio option fields for "Yes" and "No", both named [[+testopt]], see below:

    <label for="radio-1">Yes</label><input type="radio" name="testopt" id="radio-1" value="Yes" />
    <label for="radio-2">No</label><input type="radio" name="testopt" id="radio-2" value="No" />


    When none of them are selected and the form is submitted, in the received email it will display the actual modx code "[[+testopt]]". If one is selected, the value will display in the email just fine. So far, this is the only issue I’ve ever run into with FormIt.

    Any idea how to have it display nothing in the email if no one selects an option, instead of the code itself? I have a work-around, but I must be missing something.

    Sorry if my explanation seems confusing.
    -nnd
      • 37984
      • 215 Posts
      BUMP. Would love to know the answer to this.
        Jesse Couch
        MODX Aficionado, Front-End Designer & Developer
        http://www.designcouch.com
        • 37984
        • 215 Posts
        On further investigation, I have worked out a solution. Using the "notempty" property allows for this to be remedied. An example follows below of the placeholder to place in your email template (for a radio field named "example1"). If none of the fields are selected, it will result in a blank entry, and not the placeholder code.

        [[+example1:notempty=`[[+example1]]`]]
          Jesse Couch
          MODX Aficionado, Front-End Designer & Developer
          http://www.designcouch.com