We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8168
    • 1,118 Posts
    Hi,

    I am creating a dynamic form from a WayFinder call and using FormitRetreiver to allow the user of the form to complete the form on page 1, review it on page 2 (just showing the completed fields), and then either submit the form data, or head back to page 1 to make changes to the data they have input within the form. All works fine, apart from the fact that my SELECT form fields are not updating with the correct user selected data when the user moves from page 2 back to page 1.

    FormItIsSelected (https://rtfm.modx.com/extras/revo/formit/formit.tutorials-and-examples/formit.handling-selects,-checkboxes-and-radios) seems to be the way to do this - but I can't see to make it work when used within a WayFinder call - example of my code below which is not working...:

    <select name="[[+wf.alias]]_Mon" id="[[+wf.alias]]_Mon">
    <option value="0" [[+fi.[[+wf.alias]]_Mon:FormItIsSelected=`0`]] >0</option>
    <option value="1" [[+fi.[[+wf.alias]]_Mon:FormItIsSelected=`1`]] >1</option>
    <option value="2" [[+fi.[[+wf.alias]]_Mon:FormItIsSelected=`2`]] >2</option>
    </select>
    


    So the Select name is dynamic - e.g. pulled from the WayFinder found resource alias with _Mon added to it...

    Any ideas?


    Cheers,

    dubbs.

    This question has been answered by dubbs. See the first response.

      • 8168
      • 1,118 Posts
      The issue is definitely with the use of FormItIsSelected as if I replace the <select> with a standard text input all works fine...

      any ideas as I would like to use <select> options rather than text inputs...

      Thanks
        • 8168
        • 1,118 Posts
        Anyone any ideas? Something silly I am missing here I am sure....???
        • discuss.answer
          • 8168
          • 1,118 Posts
          No one got a solution for this? Could I use the if (https://rtfm.modx.com/extras/revo/if) addon perhaps? So:

          [[!If? &subject=`[[+[[+wf.alias]]_Mon]]` &operator=`=` &operand=`1` &then=`selected`]]
          


          That approach work?

          UPDATE... this works wink Well done little old me wink [ed. note: dubbs last edited this post 8 years, 4 months ago.]