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 have a formit form, which on submit - i redirect to a review page which summarises the form data, on submit click on this 2nd page the form is submitted and the user is moved to a confirmation page. From this 2nd page (the summary of form data), I would like the option for the user to click on a button to go back to the form page to update their form details... How can I do this....??

    Cant find any documentation, the back button means when you go back to the form it is blank...

    I am guessing it needs to be a button within the formit form code that formit can handle to preserve the stored data?? Do I need a FormItRetriever code call on the original form too???

    Any tips / insight anyone?

    cheers

    dubbs.

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

    • discuss.answer
      • 30585
      • 833 Posts
      I haven't tested this, but I'm pretty sure you need to call [[!FormItRetriever]] on your form page too, below the Formit call.

      Then fill your field values with Formit placeholders, as you did on the summary page:

      <input type="text" name="name" placeholder="Enter your name" value="[[!+fi.name]]">
      
        A MODx Fanatic
        • 8168
        • 1,118 Posts
        Thanks. Yep so need all form fields suffixed with fi. In all parts of the form on all pages then?
          • 30585
          • 833 Posts
          Yes. At least, for those fields whose values are updatable by the user.
            A MODx Fanatic
            • 8168
            • 1,118 Posts
            OK, so in this case its all of them, so on the original formit form - no issue with the fields all having the fi. suffix then? Will still work on page 1 of the form yeh?
              • 8168
              • 1,118 Posts
              I can see this works with text inputs... but what about <select> objects?
                • 30585
                • 833 Posts
                I think you need to use FormItIsSelected for selects:
                <select name="color">
                   <option value="blue" [[!+fi.color:FormItIsSelected=`blue`]] >Blue</option>
                   <option value="red" [[!+fi.color:FormItIsSelected=`red`]] >Red</option>
                   <option value="green" [[!+fi.color:FormItIsSelected=`green`]] >Green</option>
                   <!-- This would also work -->
                   <option value="yellow" [[!+fi.color:is=`yellow`:then=`selected`]]>Yellow</option>
                </select>
                


                This should handle the selected="selected" part.
                  A MODx Fanatic
                  • 8168
                  • 1,118 Posts
                  Of course - sorry, should have remembered that! Thanks for your assistance here wink
                    • 8168
                    • 1,118 Posts
                    Quote from: treigh at Jan 09, 2016, 03:55 PM
                    I think you need to use FormItIsSelected for selects:
                    <select name="color">
                       <option value="blue" [[!+fi.color:formitisselected="`blue`]]">Blue</option>
                       <option value="red" [[!+fi.color:formitisselected="`red`]]">Red</option>
                       <option value="green" [[!+fi.color:formitisselected="`green`]]">Green</option>
                       <!-- This would also work -->
                       <option value="yellow" [[!+fi.color:is="`yellow`:then=`selected`]]">Yellow</option>
                    </select>
                    


                    This should handle the selected="selected" part.

                    Hi, so, the theory of this works, but as the name of the selection option I have in the form is dynamically called in a WayFinder call (e.g. [[+wf.alias]]_Mon) this is not working...

                    Example of the select code as below:

                    <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>
                    


                    Any ideas on what syntax I need to use to get this to work?

                    Cheers,


                    dubbs.