We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36565
    • 73 Posts
    Hello everyone,

    I hope this question is different enough from my last thread to justify a dedicated thread.

    Is it possible or good practice to differentiate between the different submit buttons of a form by placing new FormIt calls with specific submitVars for each button alongside the form - or is submitVar rather intended to be used to differentiate between forms?

    Background:
    I want to have some submit buttons in a form redirect somewhere after processing the hook, and some other buttons just reload the form without redirect, and I'm wondering how to implement that.

    Thanks a bunch!
    René [ed. note: neo2.0 last edited this post 14 years, 1 month ago.]
      PHP illiterate MODx enthusiast
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Each "submit" button will have a different name attribute, and this will be in the POST. Just check for which submit button's name attribute is in the POST and process accordingly.
        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
        • 36565
        • 73 Posts
        Thanks, Susan, I appreciate your reading my post!

        It seems I haven't yet considered redirecting in the snippet, since I don't have an idea how to do that yet. I'm going to investigate on that topic, but would of course be very happy about hints by anyone who's reading this!

        So thanks again, MODx has a great community!
          PHP illiterate MODx enthusiast
          • 28042 ☆ A M B ☆
          • 24,524 Posts
            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
            • 36565
            • 73 Posts
            Wow, I'm humbled! Thank you *so* much.
            Case closed!
              PHP illiterate MODx enthusiast