We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21122
    • 153 Posts
    I’m using FormIt for a basic contact form, but I’m also using it for a newsletter sign up form in my sidebar.

    When I submit the contact form page, both forms submit. I’ve noticed that the way forward seems to be to use a &submitVar in the contact forms call, but they’re both still submitting, so I guess I must be doing something wrong!

    My contact form call is:

    [[!FormIt?
       &hooks=`spam,email,redirect`
       &emailTpl=`EmailReport`
       &emailTo=`[email protected]`
       &redirectTo=`123`
    &submitVar=`contactsubmit`
       &validate=`name:required,
          email:email:required,
          subject:required,
          text:required:stripTags
    ]]


    My contact form is:

    [[!+fi.error.error_message:notempty=`<p>[[!+fi.error.error_message]]</p>`]]
     
    <form id="contact" action="[[~[[*id]]]]" method="post" class="contact" name="contact">
        <input type="hidden" name="nospam:blank" value="" />
     
        <label for="name">
           Name:
        </label>
        <input type="text" name="name" id="name" value="[[!+fi.name]]" /> <span class="required">*</span><span class="error">[[!+fi.error.name]]</span>
     
        <label for="email">
            Email:
        </label>
        <input type="text" name="email" id="contact-email" value="[[!+fi.email]]" /><span class="required">*</span><span class="error">[[!+fi.error.email]]</span>
    
    <label for="telephone">
            Telephone:
           
        </label>
        <input type="text" name="telephone" value="[[!+fi.telephone]]" />
     
        <label for="subject">
            Subject:  
        </label>
        <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" /><span class="required">*</span><span class="error">[[!+fi.error.subject]]</span>
     
        <label for="text">
            Message:
        </label>
        <textarea name="text" id="text" cols="30" rows="5" value="[[!+fi.text]]">[[!+fi.text]]</textarea><span class="required">*</span><span class="error">[[!+fi.error.text]]</span>
      
        </ul>
        <br class="clear" />
     
        <div class="form-buttons">
            <input type="submit" value="Submit Form" class="contactsubmit" name="contactsubmit" />
        </div>
    </form>



    Any ideas where I might be going wrong?

    Thanks
      • 6228
      • 249 Posts
      Both forms submit? That’s very odd behaviour. The only way that should happen is if you have both forms wrapped in a common form tag, or if you have them set up to submit programatically. Can you post more info, or more code to look at?
        lo9on.com

        MODx Evolution/Revolution | Remote Desktop Training | Development