We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 44963
    • 16 Posts
    I've followed the instructions at http://rtfm.modx.com/extras/revo/formit/formit.Tutorials-and-Examples to create a support email form. Here's the beginning of the form (minus some irrelevant cosmetic stuff).

    Text fields appear to work fine, but the selects, instead of displaying my values, say

    Warning: in_array() [function-in-array]: Wrong datatype for second argument in /core/cache/includes/elements/modsnippet/25.include.cache.php on line

    Any idea what I'm doing wrong?

    [[!FormIt?
       &hooks=`spam,email,redirect`
       &emailTpl=`SupportEmail`
       &emailTo=`[email protected]`
       &redirectTo=`123`
       &validate=`name:required,
          supporttype:required,
          email:email:required,
          windowsversion:required,
          officeversion:required,
          issue:required`
    ]]
    
    [[$SupportNav]]
    
    [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
     
    <br />
    <form action="[[~[[*id]]]]" method="post" class="form">
        <input type="hidden" name="nospam:blank" value="" />
    
    
       <p class="copy" style="margin: 20px;">
       <label for="name">
            Name:
            <span class="error">[[!+fi.error.name]]</span>
        </label>
        <input type="text" name="name" id="name" value="[[!+fi.name]]" />
     
         <label for="supporttype">
            Type of support needed: [[+fi.error.supporttype]]
            <select name="supporttype" value="[[!+fi.supporttype]]">
                <option value="">Select an option...</option>
                <option value="Installing" [[!+fi.supporttype:FormItIsSelected=`Installing`]]>Installing</option>
                <option value="Purchasing" [[!+fi.supporttype:FormItIsSelected=`Purchasing`]]>Purchasing a license</option>
                <option value="Using" [[!+fi.supporttype:FormItIsSelected=`Using`]]>Using software</option>
                <option value="Suggestion" [[!+fi.supporttype:FormItIsSelected=`Suggestion`]]>Suggesting an improvement</option>
                <option value="Refund" [[!+fi.supporttype:FormItIsSelected=`Refund`]]>Requesting a refund</option>
                <option value="Other" [[!+fi.supporttype:FormItIsSelected=`Other`]]>Something else</option>
            </select>
        </label>
    </p>
     
    [ed. note: patwashburn last edited this post 12 years, 11 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Where is the rest of the form? Your select drop-down works just fine on my localhost.
        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
        • 44963
        • 16 Posts
        There are two more selects (using same code), then

           <label for="email">
                Email:
                <span class="error">[[!+fi.error.email]]</span>
            </label>
            <input type="text" name="email" id="email" value="[[!+fi.email]]" /></p>
        <p class="copy" style="margin: 20px;">
            <label for="text">
                Message:
                <span class="error">[[!+fi.error.text]]</span>
            </label><br />
            <textarea name="text" id="text" cols="75" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
         
        </p>
         
            <div class="form-buttons" style="margin-left:20px;">
                <input type="submit" value="Send Inquiry" />
            </div>
        </form>
        
        
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          What version of PHP are you using?
            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
            • 44963
            • 16 Posts
            It's PHP5 but I'm unable to tell more specifically than that.
              • 28042 ☆ A M B ☆
              • 24,524 Posts
              Go to Reports -> System Info, then click on the phpInfo(): view link. Since I have no problem with your select, copy/pasted from your post's code directly into a copy of the demo contact form from the rtfm, then I can only think that it's some variation on your server.
                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
                • 44963
                • 16 Posts
                Thank you for looking! Great community here, and it's much appreciated.