We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 39025
    • 21 Posts
    I have two formit forms on same page. One is email sign up form, one a contact us form. Submit one, it grabs the other formit mailer to process the data.

    How do I make the hook for each form use a specific mailer chunk to process?
      • 39025
      • 21 Posts
      Clarifying, the forms will use whatever hook is first.
        • 34926
        • 87 Posts
        Is your issue that the two forms are 'colliding'? I.e. the second form is using the settings from the first?
          • 40385
          • 75 Posts
          Take a look at the &submitVar property (http://rtfm.modx.com/display/ADDON/FormIt). When using multiple formit snippets on the same page you have to make sure that the &submitVar is unique for each form. This way the different formit snippets can determine which form was submitted.

          Please note: the &submitVar is the name attribut of the submit button of the corresponding form.

          Example (code is not valid/working):

          [[formit? &submitVar=`sbnFormOne`]]
          
          <form>
          <input type="submit" name="sbnFormOne">
          </form>
          
          [[formit? &submitVar=`sbnFormTwo`]]
          
          <form>
          <input type="submit" name="sbnFormTwo">
          </form>
          
          • It should work. Can you show your actual formit calls? I always assume that best practice is to use match the case of the snippet as it is listed. I could be wrong on whether it will impede function or not. It may depend on environment.
              Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. BlogTwitterLinkedInGitHub
              • 39025
              • 21 Posts
              &submitVar property

              That was it Paul, Thanks. Worked perfectly.
                • 31354
                • 24 Posts
                I seem to be having an issue with the `&submitVar` property and Bootstrap buttons.

                It seems that this will not work:
                <button class="btn btn-primary" type="submit" name="sbnContact">Submit Form</button>


                Is there a simple mod that will allow this to work properly?
                  • 36926
                  • 701 Posts
                  Quote from: VDISP at Jan 26, 2015, 08:21 AM
                  I seem to be having an issue with the `&submitVar` property and Bootstrap buttons.

                  It seems that this will not work:
                  <button class="btn btn-primary" type="submit" name="sbnContact">Submit Form</button>


                  Is there a simple mod that will allow this to work properly?

                  Try adding the subVar to a hidden input type instead. so
                  <input type="hidden" name="sbnContact" value="1" >
                  
                    • 49529
                    • 196 Posts
                    VDISP, does it work with
                    <input type="submit">
                    , not button?

                    If so, this is probably a FormIt bug.
                      • 36926
                      • 701 Posts
                      You may need to add a value to the button.
                      <button name="sbnContact" value="1">Submit</button>