We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12003
    • 21 Posts
    i have implemented eform snippet,but having some issues. Could u guys pls have a look and check if u can solve them.

    1: how to validate <select> tag? or radio/check box. i’m using eform="Select Country::1" for select tag. but it doesn’t work
    2: is there any way to strictly validate email and contact no ( i want [email protected] format and only numeric values in contact no)
    I studied eform doc, and what i came to know is, eform only validate the empty field.
    3: although values are getting submitted but the page is redirecting to home page. i want it should not be directed
    4: error message does not go away after refreshing the page.

    Thanks in advance.
      • 12379
      • 460 Posts
      1. Try:
      <select name="referral" eform="Referral:referral:1::">
      	<option value="">Choose...</option>
      	<option value="Google">Google</option>
      	<option value="Yahoo">Yahoo!</option>
      </select>

      2. http://modxcms.com/forums/index.php/topic,17574.msg110561.html#msg110561
      3. Add &thankyou=`put page id here or chunk name` to your call
      4. If you’re referring to the error that you’ve already submitted the form then add &protectSubmit=`0` which will allow resubmission of the same form.

      Checkout http://wiki.modxcms.com/index.php/EForm
        Mostly harmless.
        • 12003
        • 21 Posts
        thanks but none of the solutions works for me



        1. Try:
        <select name="referral" eform="Referral:referral:1::">
        	<option value="">Choose...</option>
        	<option value="Google">Google</option>
        	<option value="Yahoo">Yahoo!</option>
        </select>


        i tried the below code but did not work:

        <select name="country" id="country" eform="Select Country::1">
        <option value="0" selected="selected">Select</option>
        <option value="Afghanistan">Afghanistan</option>
        <option value="Albania">Albania</option>
        <option value="Algeria">Algeria</option>
        </select>





        3. Add &thankyou=`put page id here or chunk name` to your call


        tried but i don’t know why it is not worrking. i wrote &thankyou=`25` 25 is the page index.





          • 36416
          • 589 Posts
          Quote from: hemchandra at Mar 17, 2010, 01:39 PM

          thanks but none of the solutions works for me

          Is your snippet call uncached?
          [!eForm? &formId ... !]
            • 12003
            • 21 Posts
            I don’t understand what u mean:) but i have written my defined the call like this


            [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[email protected]`
            &ccsender=`1` &thankyou=`9` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`1`!]
              • 12379
              • 460 Posts
              1. <select name="referral" eform="Referral::1">
              <option value="">Choose...</option>
              <option value="Google">Google</option>
              <option value="Yahoo">Yahoo!</option>
              </select>



              4. Get rid of &gotoid=`1` as it’s redirecting back to home page.

                Mostly harmless.
                • 12003
                • 21 Posts
                it again doesn’t work, i m thinking to validate it through my own java script code with more accurate validation. will it work?
                  • 12379
                  • 460 Posts
                  Try:

                  eform="Select Country:listbox:1::"
                    Mostly harmless.
                    • 12003
                    • 21 Posts
                    hey it doesn’t work.... now i m planning to validate the form using javascript.let me see if it work.
                      • 12379
                      • 460 Posts
                      Weird. The documentation with eForm has the following example (assets/snippets/eform/docs/eform_example_multiple_forms.htm)

                                  <label>Language</label>
                                  <select name="language" eform="language::1>
                                      <option value=""></option>
                                      <optgroup label="English">
                                          <option value="en-au">Australian</option>
                                          <option value="en-gb">UK English</option>
                                          <option value="en-us">US English</option>
                                      </optgroup>
                                      <optgroup label="French">
                                          <option value="fr">France</option>
                                          <option value="fr-be">Belgian French</option>
                                          <option value="fr-ca">Canadien French</option>
                                          <option value="fr-ch">Swiss French</option>
                                          <option value="fr-gp">Guadaloupe French</option>
                                          <option value="fr-gy">Guyana French</option>
                                          <option value="fr-mr">Martinique French</option>
                                      </optgroup>
                                  </select>
                      


                      And the Wiki says:

                      Hidden fields, select boxes, radio options and checkbox fields

                      Select boxes, radio options and checkbox fields now have working automatic validation. Any input for these fields is validated against the values set in your form template. This avoids anyone tampering with the form by adding their own values to these fields.

                      Maybe somebody else can shed light on this? Admittedly I tried implementing a dropdown validation last year without much luck.
                        Mostly harmless.