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
    SOLVED:
    Using the alternate method in the Docs solved the issue now, no more errors in the error log.

        <option value="1" [[!+fi.Qty1:is=`1`:then=`selected`]]>1</option>


    Thanks for this suggestion go out to Glyn:
    https://forums.modx.com/thread/86186/warning-in-array-expects-parameter-2-to-be-array-string-given#dis-post-491558

    Errors appearing in the MODx error log, each time a page with a FormIt form loads in the browser

    .../core/cache/includes/elements/modsnippet/40.include.cache.php : 39) PHP warning: in_array() expects parameter 2 to be array, string given

    Anyone please have any tips on what may be causing this? 8 errors occur, which leads me to think is has something to do with the way I have setup my two select menus in the form.

    <div class="large-4 columns">
          <label>I want to advertise on:
            <select name="pubDate1" value="[[!+fi.pubDate1]]">
              <option value="">Choose Date</option>
              <option value="March 7" [[!+fi.week1_pubDate1:FormItIsSelected=`March 7`]]>March 7</option>
              <option value="March 14" [[!+fi.week1_pubDate1:FormItIsSelected=`March 14`]]>March 14</option>
              <option value="March 21" [[!+fi.week1_pubDate1:FormItIsSelected=`March 21`]]>March 21</option>
              <option value="March 28" [[!+fi.week1_pubDate1:FormItIsSelected=`March 28`]]>March 28</option>
            </select>
          </label>
    </div>
    <div class="large-1 columns">
          <label>Qty:
            <select name="Qty1" value="[[!+fi.Qty1]]">
              <option value="">Qty</option>
              <option value="1" [[!+fi.Qty1:FormItIsSelected=`1`]]>1</option>
              <option value="2" [[!+fi.Qty1:FormItIsSelected=`2`]]>2</option>
              <option value="3" [[!+fi.Qty1:FormItIsSelected=`3`]]>3</option>
              <option value="4" [[!+fi.Qty1:FormItIsSelected=`4`]]>4</option>
            </select>
          </label>
    </div>
    [ed. note: mmcgee last edited this post 12 years, 7 months ago.]
      • 19872
      • 1,078 Posts
      SOLVED.

      I implemented the alternate method of coding for selected—based on knowledge gained from another post and now no more pesky error messages. Structuring the line using the alternate method did the trick.

            <label>Qty:
              <select name="Qty1" value="[[!+fi.Qty1]]">
                <option value="">Qty</option>
                <option value="1" [[!+fi.Qty1:is=`1`:then=`selected`]]>1</option>
                <option value="2" [[!+fi.Qty1:is=`2`:then=`selected`]]>2</option>
                <option value="3" [[!+fi.Qty1:is=`3`:then=`selected`]]>3</option>
                <option value="4" [[!+fi.Qty1:is=`4`:then=`selected`]]>4</option>
              </select>
            </label>