We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27382
    • 9 Posts
    Use Wufoo.com and save your life.
      • 3749
      • 24,544 Posts
      BTW, the reason it looked like the CSS wasn’t working was most likely that the form didn’t get assigned to a proper template at first (or any template at all) rather than a problem with the CSS file itself. Without the template, the CSS doesn’t get injected properly.
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 19597
        • 44 Posts
        Thanks for all your help guys, I’ve done a lot more reading into FormIt and I’ve decided this is the best option for me once I learn it inside and out, so I’ll just need to tough it out until I can get my hands on it entirely.

        Currently, I’m running into one major problem. I have 1 form that is static to all pages (its in the head section of my template, before [[*content]], so it shows on all pages that use that template.

        On ONE page however, I need to have 2 forms, and I’m running into trouble with &submitVar=. The FormIt documentation isn’t very specific as to WHAT needs to be set for &submitVar=. I’ve tried setting IDs and classes to portions of the form and put that in submitVar, but it just loops back to the page again with blank form instead of going to the "thank you" page.


        Below is the code I am using (with my email removed, obviously), it’s basically just the Generic FormIt example that you can get from the documentation. Any help in figuring out how submitVar works is greatly appreciated:

        [[!FormIt?  
        &hooks='spam,email,redirect'  
        &emailTpl='MyEmailChunk'  
        &emailTo='[email protected]'  
        &redirectTo='16'
        &submitVar='form2'
        &validate='name:required,  
        email:required,  
        subject:required,  
        text:required:stripTags,  
        numbers:required,  
        colors:required'        
        ]]  
          
         <form action="[[~[[*id]]]]" method="post" class="form2">  
             <input type="hidden" name="nospam:blank" value="" />  
           
             <label for="name">  
                 Name:  
                 <span class="error">[[+fi.error.name]]</span>  
             </label>  
             <input type="text" name="name" id="name" value="[[+fi.name]]" />  
           
             <label for="email">  
                 Email:  
                 <span class="error">[[+fi.error.email]]</span>  
             </label>  
             <input type="text" name="email" id="email" value="[[+fi.email]]" />  
           
             <label for="subject">  
                 Subject:  
                 <span class="error">[[+fi.error.subject]]</span>  
             </label>  
             <input type="text" name="subject" id="subject" value="[[+fi.subject]]" />  
           
             <label for="text">  
                 Message:  
                 <span class="error">[[+fi.error.text]]</span>  
             </label>  
             <textarea name="text" id="text" cols="55" rows="7" value="[[+fi.text]]">[[+fi.text]]</textarea>  
           
           
             <label>  
                 Numbers:[[+fi.error.numbers]]  
                 <select name="numbers" value="[[+fi.numbers]]">  
                     <option value="">Select an option...</option>  
                     <option value="one" [[!+fi.numbers:FormItIsSelected=`one`]]>One</option>  
                     <option value="two" [[!+fi.numbers:FormItIsSelected=`two`]]>Two</option>  
                     <option value="three" [[!+fi.numbers:FormItIsSelected=`three`]]>Three</option>  
                 </select>  
             </label>  
           
             <label>  
                 Colors:[[+fi.error.colors]]  
                 <input type="hidden" name="colors[]" value="" />  
             </label>  
             <ul>  
               <li>  
                 <label><input type="checkbox" name="colors[]" value="red" [[!+fi.colors:FormItIsChecked=`red`]] /> Red</label>  
               </li>  
               <li>  
                 <label><input type="checkbox" name="colors[]" value="blue" [[!+fi.colors:FormItIsChecked=`blue`]] /> Blue</label>  
               </li>  
               <li>  
                 <label><input type="checkbox" name="colors[]" value="green" [[!+fi.colors:FormItIsChecked=`green`]] /> Green</label>  
               </li>  
             </ul>  
           
             <br class="clear" />  
             [[!+formit.recaptcha_html]]  
             [[!+fi.error.recaptcha]]  
           
             <br class="clear" />  
           
             <div class="form-buttons">  
                 <input type="submit" id="environment-submit" value="Send Contact Inquiry" />  
             </div>  
        </form> 
        



        Can someone (using the code example above) please show me the proper input value for SubmitVar? Thank you very much!
          • 3749
          • 24,544 Posts
          I think its value has to match the name of your submit button.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 19597
            • 44 Posts
            Quote from: BobRay at Jan 13, 2011, 03:35 PM

            I think its value has to match the name of your submit button.

            I tried that with the id=environment-test, and I set the var to environment-test, it didn’t seem to work.

            Does it actually have to be name= ?


            Seems like you haven’t used FormIt before either? (or at least not the submitvar property), but I really appreciate you taking the time to try and give me insight! You’ve already been sincerely helpful


            Any other enlightening information into submitvar is greatly appreciated
              • 28215
              • 4,149 Posts
              Quote from: Minaris at Jan 13, 2011, 04:00 PM

              Does it actually have to be name= ?
              Yes, because id= is not submitted in the POST. name= is.
                shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                • 19597
                • 44 Posts
                Quote from: splittingred at Jan 13, 2011, 04:10 PM

                Quote from: Minaris at Jan 13, 2011, 04:00 PM

                Does it actually have to be name= ?
                Yes, because id= is not submitted in the POST. name= is.

                Ok good to know, but it still doesn’t seem to be working for me...

                I now have :

                [[!FormIt?  
                &hooks='spam,email,redirect'  
                &emailTpl='MyEmailChunk'  
                &emailTo='[email protected]'  
                &redirectTo='16'
                &submitVar='form1-submit'
                &validate='name:required,  
                email:required,  
                subject:required,  
                text:required:stripTags'        
                ]]  
                   
                 
                 <form action="[[~[[*id]]]]" method="post" class="form">  
                     <input type="hidden" name="nospam:blank" value="" />  
                   
                     <label for="name">  
                         Name:  
                         <span class="error">[[+fi.error.name]]</span>  
                     </label>  
                     <input type="text" name="name" id="name" value="[[+fi.name]]" />  
                   
                     <label for="email">  
                         Email:  
                         <span class="error">[[+fi.error.email]]</span>  
                     </label>  
                     <input type="text" name="email" id="email" value="[[+fi.email]]" />  
                   
                     <label for="subject">  
                         Subject:  
                         <span class="error">[[+fi.error.subject]]</span>  
                     </label>  
                     <input type="text" name="subject" id="subject" value="[[+fi.subject]]" />  
                   
                     <label for="text">  
                         Message:  
                         <span class="error">[[+fi.error.text]]</span>  
                     </label>  
                     <textarea name="text" id="text" cols="55" rows="7" value="[[+fi.text]]">[[+fi.text]]</textarea>  
                   
                     <br class="clear" />  
                   
                     <div class="form-buttons">  
                         <input type="submit" name="form1-submit" value="Send Contact Inquiry" />  
                     </div>  
                </form> 


                However, even though I have set the SubmitVar to match the name= of the submit button, it still doesn’t bring me to the Thank You page on submission, and I receive no email.


                Any thoughts?
                  • 19597
                  • 44 Posts
                  It seems like when I copy/paste cookie cutter FormIt calls, it works

                  However, if I delete the ’ ’ marks around the instructions, and replace them with my own ’ ’ marks, it suddenly breaks.

                  Am I using the wrong hash/tick mark or something?
                    • 3749
                    • 24,544 Posts
                    Quote from: Minaris at Jan 13, 2011, 06:02 PM

                    It seems like when I copy/paste cookie cutter FormIt calls, it works

                    However, if I delete the ’ ’ marks around the instructions, and replace them with my own ’ ’ marks, it suddenly breaks.

                    Am I using the wrong hash/tick mark or something?

                    Exactly. wink

                    Those are back ticks, not single quotes and they’re required for every snippet parameter. They’re typed with Shift-~ on most keyboards -- at the upper left.
                      Did I help you? Buy me a beer
                      Get my Book: MODX:The Official Guide
                      MODX info for everyone: http://bobsguides.com/modx.html
                      My MODX Extras
                      Bob's Guides is now hosted at A2 MODX Hosting
                      • 19597
                      • 44 Posts
                      Quote from: BobRay at Jan 13, 2011, 08:33 PM

                      Quote from: Minaris at Jan 13, 2011, 06:02 PM

                      It seems like when I copy/paste cookie cutter FormIt calls, it works

                      However, if I delete the ’ ’ marks around the instructions, and replace them with my own ’ ’ marks, it suddenly breaks.

                      Am I using the wrong hash/tick mark or something?

                      Exactly. wink

                      Those are back ticks, not single quotes and they’re required for every snippet parameter. They’re typed with Shift-~ on most keyboards -- at the upper left.

                      Is there a smack my hand on my head emoticon? Such a brain stall! Thanks for pointing that out for me smiley