We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36551
    • 416 Posts
    I'm stumped.

    I have two forms one page and have included &submitVar with unique IDs on each form. Each form works separately. Two forms without &submitVar will process and deliver the email but with info from the other form (as expected).

    As soon as I add &submitVar to the FormIt call, the form does not send and email.

    MOdX 2.2.5-pl
    FormIt 2.1.1
    There are a couple of jquery script for scrolling and validation. Removing them has no effect.
    Shared Hosting

    Here's one of the forms: (not all fields)

    [[!FormIt? 
    &hooks=`spam,email,redirect` 
    &emailTpl=`emailsendto` 
    &emailTo=`myemailaddress.com` 
    &submitVar=`contactform`
    ]]
    
    <div id="form_container">
    
    <form class="form" action="[[~[[*id]]]]#thank-you" method="post" name="contactform" id="contactform">
      <input type="hidden" name="nospam:blank" /> 
    
      <div id="firstname">  
         <label for="nameone">First Name*: </label><br /> 
         <input id="nameone" type="text" name="nameone" value="[[!+fi.nameone]]" />
       </div><!--firstname-->
    
      ...
    
      <label id="commentslabel" for="text">Message*</label><br /> 
      <textarea id="text" name="text" rows="12" cols="15">[[!+fi.text]]</textarea> <br />
    
      <div class="form-buttons"><input name="contactform" type="submit" value="" /></div>
    
    </form>
    </div><!--form_container-->
    


    Any suggestions?
      • 30912
      • 463 Posts
      Hiya,

      I;ve had a simialar problem in the past, ensure that ALL of your field names are unique as well as changing the form id and class name - this sorted it for me as it was conflicting with my validation in the formit call.

      HTH
        • 36551
        • 416 Posts
        HTH Thank you!

        I removed the contact form from the page and updated the remaining form that has only two fields. ALL IDs, names and classes are unique within the form.

        Still no emails are being sent?

        I would be happy to provide manager access to someone who can spot the problem here.

        
        [[!FormIt? 
        &hooks=`checkDefaultValues,spam,email,FormItAutoResponder` 
        &emailTpl=`tryitemailsendto` 
        &fiarTpl=`tryitemailcc` 
        &fiar=`Name of Website` 
        &fiarSubject=`Try it Out` 
        &emailTo=`[email protected]` 
        &submitVar=`tryitformsubmit`
        &emailUseFieldForSubject=`0` 
        ]]
        
        <div id="try-it-form_container">
        <p>[[!+fi.error_message:notempty=`[[!+fi.error_message]]`]]</p>
        <form class="form" action="[[~[[*id]]]]#thankyou" method="post" name="try-form" id="try-it-form">
          <input type="hidden" name="nospam:blank" /> 
          <label for="tryitemail1">Your Email Address:</label><br /> 
          <input id="tryitemail2" type="text" name="tryitemail" value="" /> <br /> 
          <label for="tryitphone1">Your Mobile Phone Number: </label><br />
          <input id="tryitphone2" type="text" name="tryitphone" value="[[!+fi.tryitphone]]" /> <br /> 
          <div class="tryit-button"><input name="tryitformsubmit" type="submit" value="" /></div>
        </form>
        </div><!--form_container-->
        


          • 36551
          • 416 Posts
          Well it seems that this needs some value even a space.

          <input name="tryitformsubmit" type="submit" value="" />

          Now it's working as expected.
            • 31902
            • 342 Posts
            Yeah, I was having problems too and the space in the value cleared it up for me as well. I wonder why? I hate these little hidden bugaboos that don't make sense and require one to stumble on the solution by chance.

            Anyway, it solved hours of troubleshooting, so thanks!