We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12151
    • 115 Posts
    hi there. i have a form with a multiple select listbox but when i submit the form to eForm (1.4.3) the report only shows the last item selected in the list. how can i change this to show all the items selected?

    snippet call:

    [[eForm? &formid=`feedbackForm` &to=`[email protected]` &tpl=`eContactForm` 
    &report=`eContactReport` &thankyou=`eContactThanks` &vericode=`1` &subject=`Web site contact form`]]


    form field:

    <select name="Jobs" size="4" multiple="multiple" id="Jobs" eform="Select jobs:listbox:1">
          <option value="job1">Job 1</option>
          <option value="job2">Job 2</option>
          <option value="job3">Job 3</option>
          <option value="job4">Job 4</option>
    </select>


    report:

    Jobs Selected: [+Jobs+]


    ie, if i select "Job1", and "Job3" the report only shows "Job3".

    any help would be greatly appreciated!
      • 11975
      • 2,542 Posts
      Hi,

      I’ve not tested it but you should change the name of the select to trasform it in an array


      <select name="Jobs[]" size="4" multiple="multiple" id="Jobs" eform="Select jobs:listbox:1">
      <option value="job1">Job 1</option>
      <option value="job2">Job 2</option>
      <option value="job3">Job 3</option>
      <option value="job4">Job 4</option>
      </select>

      :-)
        Made with MODx : [url=http://www.copadel.com]copadel, fruits et l
        • 12151
        • 115 Posts
        this gives me the following validation error:

        Select jobs » Incorrect value

        this occurs whether i remove the eform tag from the select tag, or if i change the validation format to text. there isn’t an array format is there?
          • 33337
          • 3,975 Posts
          Try this:


          <select name="Jobs" size="4" multiple="multiple" id="Jobs" eform="Select jobs:listbox:1">
          <option value="job1[+Jobs:job+]">Job 1</option>
          <option value="job2[+Jobs:job2+]">Job 2</option>
          <option value="job3[+Jobs:job3+]">Job 3</option>
          <option value="job4[+Jobs:job4+]">Job 4</option>
          </select>

          where [+name_of_field:option_value+] is the syntax.
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link