We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    I have a sidebar form which submits its info elsewhere, however regardless of what I do - the sidebar form always displays a thank you message.

    How do I switch it off?

    // I've tried this, but it defaults to the present thank you message.
    &thankyou=``
    
      • 30585
      • 833 Posts
      You need to remove the &gotoid=`x` argument where x represents the page it’s displaying after the form is submited.

        A MODx Fanatic
        • 32645
        • 377 Posts

        You need to remove the &gotoid=`x` argument  where x represents the page it’s displaying after the form is submited.

        Sorry, but I can’t get it to disappear.  Could you clarify what you mean?  How do you stop the thank you message from displaying?

        I’ve tried:

        &goto=``          // still displays a thank you message in the sidebar
        &thankyou=``   // still displays a thank you message in the sidebar
        &goto=`[*id*]` // still displays a thank you message in the sidebar
        


        This is my call;

        [!eForm? &formid=`ContactForm` &subject=`Subject` &to=`[+Email+] &from=`[email protected]` &tpl=`Sidebar_Newsletter_Chunk` &report=`xContactFormReport` &protectSubmit=`0` !]
        
          • 36416
          • 589 Posts
          Quote from: worchyld at May 06, 2008, 04:18 AM

          Sorry, but I can’t get it to disappear. Could you clarify what you mean? How do you stop the thank you message from displaying?
          &goto=`[*id*]` // still displays a thank you message in the sidebar
          


          Its &gotoid=`someid` not &goto=`id`, boyo... wink
            • 32645
            • 377 Posts
            Its &gotoid=`someid` not &goto=`id`, boyo...

            But if I put;

            &gotoid=`11` &thankyou=``
            


            It still shows a thank you message.
              • 6726
              • 7,075 Posts
              Wild guess but I’d say if you leave the parameter empty like this, it gets replaced by default thank you message...
              Maybe use it like this &thankyou=` ` (with a space) or else create an empty chunk...

              Other solution is to check out eForm’s code and tweak it
                .: COO - Commerce Guys - Community Driven Innovation :.


                MODx est l'outil id
                • 32645
                • 377 Posts
                I’ll try a space and see what that does.


                Other solution is to check out eForm’s code and tweak it

                Yes, I think that might be the solution as the code goes like this;

                if(!empty($thankyou) ){
                 // ... some code
                } else {
                   return $_lang['ef_thankyou_message'];
                }
                


                So, if it is empty - it will return the default message.  I might add a tweaked variable to help out.


                EDIT:

                If you set &thankyou=` ` (with a space) it returns;


                Document or chunk not found for template id= ’ ’

                So, its just a case of tweaking the Eform snippet as expressed above.

                  • 32645
                  • 377 Posts
                  I’ve got it working, but it doesn’t return to the sidebar form - which is what I was expecting.

                  I tried recalling the Chunk via &thankyou=`chunkname` (where chunkname is the same as the current chunk name which is a EForm call), but that only outputted the Eform call but did not execute it.

                  I tried calling a chunk via &thankyou and then made the thankyou page call the Eform. This had the same effect as above.

                  In the end I just made the form disappear and the thank you page disappear. Which’ll do for now....

                  But assuming that my client wants the sidebar form to return upon form submission, how do I get it back?

                  Here’s what I’ve done so far;

                  // added the following line into the Eform snippet under 'thankyou' part
                       'usethankyou' => isset($usethankyou)? $usethankyou:1,
                  


                  // changed the return $_lang['ef_thankyou_message']; in "eform.inc.php" to the following;
                  
                  if (!isset($usethankyou)) $usethankyou=1;
                  
                  if($usethankyou==1){
                    return $_lang['ef_thankyou_message'];
                  } else {
                    return '';
                  } // end if