We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 20041
    • 83 Posts
    Hi!
    I have my contact form ready.
    It has 4 fields. ( Some of the fields should not be left blank.)
    Can I validate it using eForm?
    I also want to display a message when user clicks send button and sends the message.
    No need for cc or bcc..its a simple form.
    Please tell me how to do it.
    or point me to tutorials if any (I saw some examples but with tables)
    Thanks for your time.
      • 7923
      • 4,213 Posts
      You can use the &format parameter at the snippet call for validation. Look for instructions from the snippet thread.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 20041
        • 83 Posts
        Running eForm gave me the following error:
        [tt]Parse error: syntax error, unexpected ’<’ in D:\xampp\htdocs\powervsn\modx2\manager\includes\document.parser.class.inc.php(705) : eval()’d code on line 1[/tt]
        I am using it on my local win2k pc.
        Here is what I did.
        1) Installing the snippet
        (Could not follow the instruc. to unzip /install, /assets to site root as there is already an /assets folder there.) So copied contents of eForm to /assets/snippets/eform. Copied eform.inc.php to /eform/
        Created a new snippet, named it eForm, copied contents of eform.inc.php to it.
        2)Called the snippet as
        [[eForm? &to=`mailadress.com` &tpl=`9` &formid=`pvForm` &tpl=`cform` &report=`creport`  &format=`name:Name:string:1,email:Email:email:1,country:Country:string:0,subject:Subject:string:0,message:Message:string:1`]]

        where cform is the chunk that holds the form, creport is the feedback message(Thank you.etc..) chunk.
        Please tell me what I am doing wrong here.
        Thanks you for your time..sorry for the long post.
          • 33337
          • 3,975 Posts
          Get updated eform: http://modxcms.com/forums/index.php/topic,2122.msg34495.html#msg34495

          Get eform parser: http://modxcms.com/forums/index.php/topic,2122.msg35514.html#msg35514 (it has easy way to assign validation to input and no need for looooooooong &format calls)

          Follow the instructions, its pretty easy, read carefully.

          Other than this I am writing a tutorial on eForm, eForm is AWESOME btw! but I cant tell you right now if it comes out in couple of days or in couple of weeks tongue... but its coming!

          Thanks for your patience.

          regards.

          zi
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 20041
            • 83 Posts
            Thanks Zi for the quick reply. This is not the first time you are saving me. rolleyes
            Willl try the new zips..
            btw, eform.inc.php is present in both zips..which one do I use? also where to put the eformparser.inc.php file?
            thanks a million.
              • 7455
              • 2,204 Posts
              Quote from: modxusr at Jun 26, 2006, 12:13 AM

              Running eForm gave me the following error:
              [tt]Parse error: syntax error, unexpected ’<’ in D:\xampp\htdocs\powervsn\modx2\manager\includes\document.parser.class.inc.php(705) : eval()’d code on line 1[/tt]
              I am using it on my local win2k pc.
              Here is what I did.
              1) Installing the snippet
              (Could not follow the instruc. to unzip /install, /assets to site root as there is already an /assets folder there.) So copied contents of eForm to /assets/snippets/eform. Copied eform.inc.php to /eform/
              Created a new snippet, named it eForm, copied contents of eform.inc.php to it.
              2)Called the snippet as
              [[eForm? &to=`mailadress.com` &tpl=`9` &formid=`pvForm` &tpl=`cform` &report=`creport`  &format=`name:Name:string:1,email:Email:email:1,country:Country:string:0,subject:Subject:string:0,message:Message:string:1`]]

              where cform is the chunk that holds the form, creport is the feedback message(Thank you.etc..) chunk.
              Please tell me what I am doing wrong here.
              Thanks you for your time..sorry for the long post.

              this part
              Created a new snippet, named it eForm, copied contents of eform.inc.php to it.
              

              is not ok you need to copy the content of the eform.snippet file not the  eform.inc.php file that file needs to be in the assets/snippets/eform.

              try switching the richtext editor of it changes all & to &amp; change them back and make the call 1 line no enters in it ald remove the &nbsp;(spaces made by the richtext editor). I use a chunk for long calls like this so its not converted by the texteditor and the editor is still usable.

              Hope this helps

              Dimmy

                follow me on twitter: @dimmy01
                • 20041
                • 83 Posts
                Thanks Dimmy! Guess what I did wrong was I did not install.
                But I guess I’ll use the updated eForm files.
                btw, eform.inc.php is present in both zips..which one do I use? also where to put the eformparser.inc.php file?
                Thanks.
                  • 7455
                  • 2,204 Posts
                  Quote from: modxusr at Jun 26, 2006, 02:30 AM

                  Thanks Dimmy! Guess what I did wrong was I did not install.
                  But I guess I’ll use the updated eForm files.
                  btw, eform.inc.php is present in both zips..which one do I use? also where to put the eformparser.inc.php file?
                  Thanks.

                  use the latest one the one from: http://modxcms.com/forums/index.php/topic,2122.msg34495.html#msg34495

                  Dimmy
                    follow me on twitter: @dimmy01
                    • 20041
                    • 83 Posts
                    Yes, I’ll use that. Thanks.
                    What about the eformparser file? where do I put it?
                      • 25663 MODX Staff
                      • 12,272 Posts
                      assets/snippets/eform/eform.parser.inc.php

                      to go with

                      assets/snippets/eform/eform.inc.php
                        Ryan Thrash, MODX Co-Founder
                        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me