We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Can you post your eForm snippet with its parameters?
      Studying MODX in the desert - http://sottwell.com
      Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
      Join the Slack Community - http://modx.org
      • 16501
      • 28 Posts
      It’s as per the example as provided by TobyL...

      i followed the example to the letter..
        • 34017
        • 898 Posts
        I had never seen this tutorial. It’s very nice. Thanks Toby.
          Chuck the Trukk
          ProWebscape.com :: Nashville-WebDesign.com
          - - - - - - - -
          What are TV's? Here's some info below.
          http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
          http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
          • 32380
          • 137 Posts
          Does any one know how to implement this with the eForm form split?
          found here http://modxcms.com/forums/index.php/topic,8572.msg60381.html#msg60381

          My eform call Call:
          [[multiFormFunctions]]
          [!eForm? &formid=`contact` &tpl=`multiForm1` &eFormOnBeforeFormParse=`beforeParseFunction` &eformOnBeforeMailSent=`beforeMailSentFunction` &thankyou=`formReport` &report=`formReport` &to=`email@address` !]
          


          TV called ’Glass’ set to dropdown list menu (these when selected it pulls in the correct chunk to show a drop down list to show in the form)
          Suffolk=={{SuffolkGlass}}|| Norfolk=={{NorfolkGlass}}||  Essex=={{EssexGlass}}||  Bedford=={{BedfordGlass}}||  Kent== {{KentGlass}}|| Surrey=={{SurreyGlass}}||  Sussex=={{SussexGlass}}
          


          This show up on the form correctly but when moving to the next page eForm errors saying invalided value.
          Now hopefully this code mentioned in this thread should phrase the TV before eForm moves to the next step but im not sure how to add another FormOnBeforeFormParse hopefully someone can help?
            • 32380
            • 137 Posts
            Humpp no suggestions, do you think there is an easier way to implement a form with aprox 20 questions (some questions will be specific to the item and will be controlled by a TV).
            I’m really running out of time to get this working aghhhhh
              • 5311
              • 5 Posts
              Quote from: kwacky1 at Jul 27, 2009, 04:10 AM

              huh

              Hi Sorry if this is a stupid question, but when trying to implement this example I get the following error after submitting the form...

              Fatal error: Call to undefined function eformGetTvDates() ...


              Where have I gone wrong?



              Sorry to bump. Just had this issue. Seemed to go away by making the resource non-cacheable. It also fails if there are syntax errors in the function. Remove &eFormOnBeforeFormParse and see if any errors are outputted.
                • 15003
                • 85 Posts
                I am having the same problem as Cider.
                Fatal error: Call to undefined function eformGetTvTherapist() in ..../assets/snippets/eform/eform.inc.php on line 139
                Below is the snippet and form call I’m using. Not sure what I’m doing wrong, anybody got any ideas?

                Thanks for any help offered, Jules

                Snippet:
                <?php
                if( !function_exists('eformGetTvTherapist') ) {
                	function eformGetTvTherapist(&$fields,&$templates){
                		global $modx;
                		$rawvalue = $modx->getTemplateVarOutput('tv_preferred-therapist');		
                		$dates = explode("\n",$rawvalue['tv_preferred-therapist']);
                		foreach( $dates as $dateString ){
                			$dateString = trim($dateString);
                			if($dateString) $options .= "<option value=\"$dateString\">$dateString</option>\n";
                		}
                		$templates['tpl']=str_replace('[+display_tv_preferred-therapist+]',$options,$templates['tpl']);
                		return true;
                	}
                }
                
                return '';
                ?>


                Form Call:
                [!af_checkField!]
                [!eForm? &formid=`appointmentForm` &tpl=`appointment-form-template` &report=`af-email-to-admin` &subject=`Massage Center of Bellevue` &automessage=`af-email-to-user` &replyto=`email` &eFormOnValidate=`af_checkField` &eFormOnBeforeFormParse=`eformGetTvTherapist` &gotoid=`14`!]


                  • 15003
                  • 85 Posts
                  Update: I added the snippet function to eform.inc.php and everything works perfectly, but hacking code that will be updated in the future isn’t always the best avenue.

                  I’m not familiar enough with MODx to understand why it isn’t picking up the snippet call. I know this is an older post and maybe I should just start a new thread on the subject. Is there anybody out there that can shed a little light on the situation?

                  Cheers!
                  Jules

                  UPDATE: For those interested I ended removing it from eform.inc.php and keeping as a snippet: eformGetTvTherapist. I then added it as an Uncached snippet call from within my html, above the form - [!eformGetTvTherapist!]
                    • 21700
                    • 42 Posts
                    Quote from: sottwell at Sep 04, 2008, 05:14 AM

                    How does this work if the email field is required, but the field is hidden?

                    Wow, sorry, never got back to this post embarrassed. The idea of the script I posted was that users or non-users can use the same feedback/contact page. If a user is logged in, the script automatically uses that email address (and hides the formfield). If a user is not logged in, it will ask the user for his/her email-address.

                    Regards, noes