We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30223
    • 1,010 Posts
    Quote from: roki13 at Aug 08, 2007, 02:49 AM

    done : http://wiki.modxcms.com/index.php/EForm#Examples
    feel free to correct my english embarrassed

    Thank you very much for sharing !

    Quote from: pbowyer at Aug 08, 2007, 03:16 AM

    I’ve got an eform form with a select box, and no validation rules set up:
    <select name="title" id="title">
                <option value="">select title</option>
                <option value="Mr">Mr</option>
                <option value="Mrs">Mrs</option>
    </select>


    No validation rule should mean when I don’t select a title (ie when ’select title’ is selected) there is no error.

    However when I do not select a title it gives the error
    title » Incorrect value

    What can I do to stop this error? A work-around is to insert value="." for the default option... but I don’t want any value set.

    A slight shortcoming in the parsing... Try setting a validation rule like eform="::0:Incorrect value:#VALUE ,Mr,Mrs"
      • 32319
      • 129 Posts
      Has anyone done an eForm implementation that used the form data to fill in a PDF document and send the document to the user (presumably using FDF)?

      If not, has anyone done any kind of FDF implementation in MODx? I would be interested in what resources you used.

      Thanks
        "Regret for the things we did can be tempered by time; it is regret for the things we did not do that is inconsolable."
        -- Sydney Harris
        • 32645
        • 377 Posts
        Quick question...

        Is there a way to make eform send email in plain text format (converting unix characters like \r or \n where necessary) rather than HTML?

          • 30223
          • 1,010 Posts
          From the eForm documentation:
          &sendAsText (optional)
          Force email message to be in plain text. Possible values: &sendAsText=`1`- send all messages as text only, &sendAsText=`report,autotext,mobile`- send specified messages as text only
            • 25737
            • 62 Posts
            Someone please help!!! When I submit the form it does nothing... No validation, no submit, nothing.

            I have created a ContactForm2 & ContactFormReport2

            Here’s what I am using to call out the form:
            [!eForm? &formid=`ContactForm2` &report=`ContactFormReport2` &category=`Product Order` &ccsender=`1` &to=`[email protected]` &tpl=`ContactForm2` &format=`Parent_Name:Parent Name:string:1,Mailing_Address:Mailing Address:string:1,Contact_Number:Contact Number:string:1,Email_Address:Email Address:string:1,Acceptance:Liability Waiver Acceptance:string:1'!]


            Here is my form:

            <form method="post" action="[~[*id*]~]" name="EmailForm" id="contact-main" onsubmit="return radio_button_checker()">
            		<br />
            		<label>Parent Name:
            		<input name="Parent_Name" id="CFParent_Name" type="text" eform="Parent Name::1:" />
            		</label>
            		<br />
            		<label>Children's Names:
            		<input name="Childrens_Names" id="CFChildrens_Names" type="text" />
            		</label>
            		<br />
            		<label>Children's Ages:
            		<input name="Childrens_Ages" id="CFChildrens_Ages" type="text" />
            		</label>
            		<br />
            		<label>Mailing Address:
            		<input name="Mailing_Address" id="CFMailing_Address" type="text" eform="Mailing Address::1:" />
            		</label>
            		<br />
            		<label> 
            		<input name="Mailing_Address2" id="CFMailing_Address2" type="text" />
            		</label>
            		<br />
            		<label>Contact Number:
            		<input name="Contact_Number" id="CFContact_Number" type="text" eform="Contact Number::1:" />
            		</label>
            		<br />
            		<label>Email Address:
            		<input name="Email_Address" id="CFEmail_Address" type="text" eform="Email Address::1:" />
            		</label>
            		<br />
            		<label>Confirmation Preference:
            		<select name="Confirmation_Preference" id="CFConfirmation_Preference">
            			<option selected="selected">Choose one...</option>
            			<option value="Phone">Phone</option>
            			<option value="Email">Email</option>
            		</select>
            		</label>
            		<br />
            		<label style="float:left;">Rental Period <strong>From</strong>:
            		<select name="Rental_Period_Month" id="CFRental_Period_Month" style="width:82px;">
            			<option value="January" selected="selected">January</option>
            			<option value="February">February</option>
            			<option value="March">March</option>
            			<option value="April">April</option>
            			<option value="May">May</option>
            			<option value="June">June</option>
            			<option value="July">July</option>
            			<option value="August">August</option>
            			<option value="September">September</option>
            			<option value="October">October</option>
            			<option value="November">November</option>
            			<option value="December">December</option>
            		</select>
            		</label>
            		<label style="width:42px; margin-left:70px; float:left; margin-right:15px;">
            		<select name="Rental_Period_Day" id="CFRental_Period_Day" size="1" style="width:45px;">
            			<option value="1" selected="selected">1</option>
            			<option value="2">2</option>
            			<option value="3">3</option>
            			<option value="4">4</option>
            			
            			<option value="5">5</option>
            			<option value="6">6</option>
            			<option value="7">7</option>
            			<option value="8">8</option>
            			<option value="9">9</option>
            			<option value="10">10</option>
            			
            			<option value="11">11</option>
            			<option value="12">12</option>
            			<option value="13">13</option>
            			<option value="14">14</option>
            			<option value="15">15</option>
            			<option value="16">16</option>
            			
            			<option value="17">17</option>
            			<option value="18">18</option>
            			<option value="19">19</option>
            			<option value="20">20</option>
            			<option value="21">21</option>
            			<option value="22">22</option>
            			
            			<option value="23">23</option>
            			<option value="24">24</option>
            			<option value="25">25</option>
            			<option value="26">26</option>
            			<option value="27">27</option>
            			<option value="28">28</option>
            			
            			<option value="29">29</option>
            			<option value="30">30</option>
            			<option value="31">31</option>
            		</select>
            		</label>
            		<label style="width:42px; float:left;">
            		<select name="Rental_Period_Year" size="1" id="CFRental_Period_Year" style="width:63px;">
            			<option value="2007" selected="selected">2007</option>
            			<option value="2008">2008</option>
            		</select>
            		</label>
            		<div class="clear"></div>
            		<label style="float:left;">Rental Period <strong>To</strong>:
            		<select name="Rental_Period_End_Month" id="CFRental_Period_End_Month" style="width:82px;">
            			<option value="January" selected="selected">January</option>
            			<option value="February">February</option>
            			<option value="March">March</option>
            			<option value="April">April</option>
            			<option value="May">May</option>
            			<option value="June">June</option>
            			<option value="July">July</option>
            			<option value="August">August</option>
            			<option value="September">September</option>
            			<option value="October">October</option>
            			<option value="November">November</option>
            			<option value="December">December</option>
            		</select>
            		</label>
            		<label style="width:42px; margin-left:70px; float:left; margin-right:15px;">
            		<select name="Rental_Period_End_Day" size="1" id="CFRental_Period_End_Day" style="width:45px;">
            			<option value="1" selected="selected">1</option>
            			<option value="2">2</option>
            			<option value="3">3</option>
            			<option value="4">4</option>
            			
            			<option value="5">5</option>
            			<option value="6">6</option>
            			<option value="7">7</option>
            			<option value="8">8</option>
            			<option value="9">9</option>
            			<option value="10">10</option>
            			
            			<option value="11">11</option>
            			<option value="12">12</option>
            			<option value="13">13</option>
            			<option value="14">14</option>
            			<option value="15">15</option>
            			<option value="16">16</option>
            			
            			<option value="17">17</option>
            			<option value="18">18</option>
            			<option value="19">19</option>
            			<option value="20">20</option>
            			<option value="21">21</option>
            			<option value="22">22</option>
            			
            			<option value="23">23</option>
            			<option value="24">24</option>
            			<option value="25">25</option>
            			<option value="26">26</option>
            			<option value="27">27</option>
            			<option value="28">28</option>
            			
            			<option value="29">29</option>
            			<option value="30">30</option>
            			<option value="31">31</option>
            		</select>
            		</label>
            		<label style="width:42px; float:left;">
            		<select name="Rental_Period_End_Year" size="1" id="CFRental_Period_End_Year" style="width:63px;">
            			<option value="2007" selected="selected">2007</option>
            			<option value="2008">2008</option>
            		</select>
            		</label>
            		<div class="clear"></div>
            		<p style="margin-left:56px; ">Accomodation Arrangements:
            		<input type="radio" value="Home" name="radio_button" style="width:30px; margin-left:22px;" checked />Home</input>
            		<input type="radio" value="Hotel" name="radio_button" style="width:30px;" />Hotel</input>
            		<input type="radio" value="Apartment" name="radio_button" style="width:30px; " />Apartment</input>
            		<input type="radio" value="Condo" name="radio_button" style="width:30px; " />Condo</input><br />
            		<input type="radio" value="BB" name="radio_button" style="width:30px; margin-left:187px; " />B&B </input>
            		<input type="radio" value="Resort" name="radio_button" style="width:30px; " />Resort</input>
            		<input type="radio" value="Other" name="radio_button" style="width:30px; " />Other</input>
            		</p>
            		<label>Delivery Residence or Hotel Name:
            		<input name="Delivery_Residence" id="CFDelivery_Residence" type="text" />
            		</label>
            		<br />
            		<label>Street Name:
            		<input name="Street_Name" id="CFStreet_Name" type="text" />
            		</label>
            		<br />
            		<label>Apt/Suite/Room:
            		<input name="Room" id="CFRoom" type="text" />
            		</label>
            		<br />
            		<label>City:
            		<input name="City" id="CFCity" type="text" />
            		</label>
            		<br />
            		<label>Zip Code:
            		<input name="Zip_Code" id="CFZip_Code" type="text" />
            		</label>
            		<br />
            		<label>Local Contact Number:
            		<input name="Local_Contact_Number" id="CFLocal_Contact_Number" type="text" />
            		</label>
            		<br />
            		<label>Cell Phone Number During Stay:
            		<input name="Number_During_Stay" id="CFNumber_During_Stay" type="text" />
            		</label>
            		<br />
            		<p>Outbound Baby Company is a complete baby service, if you have additional needs or special requirements, please let us know:</p>
            		<label style="height:97px; ">Comments:
            		<textarea name="Special_Requirements" id="contact-comment-main" rows="9" cols="18"></textarea>
            		</label>
            		<br /><br />
            		<label>Finally, please let us know how you heard about us?
            		<input name="Heard" id="CFHeard" type="text" />
            		</label>
            		<br />
            		<label style="height:130px; ">
            		<textarea name="Liability" id="CFLiability" style="width:380px; height:130px; font-size:10px; ">LIABILITY WAIVER
            		
            LESSEE (CUSTOMER AND EACH OF ITS SUCCESSORS, ASSIGNS, AGENTS, OFFICERS, DIRECTORS, SHARHOLDERS, PARTNERS, SERVANTS, AGENTS AND EMPLOYEES, COLLECTIVLEY REFERRED TO AS “LESSEE”) ACKNOWLEDGES AND AGREES THAT: (a) EACH ITEM OF LEASED PROPERTY IS OF A TYPE, DESIGN, QUALITY AND MANUFACTURE SELECTED BY LESSEE, ACCEPTABLE TO LESSEE AND SUITABLE FOR LESSEE'S PURPOSES; (b) LESSOR (Outbound Baby, LLC, AND EACH OF ITS SUCCESSORS, ASSIGNS, AGENTS, OFFICERS, DIRECTORS, SHARHOLDERS, PARTNERS, SERVANTS, AGENTS AND EMPLOYEES, COLLECTIVLEY REFERRED TO AS “LESSOR”) IS NOT THE MANUFACTURER OR SUPPLIER OF THE EQUIPMENT OR THE REPRESENTATIVE OF EITHER; (c) LESSOR IS NOT REQUIRED TO ENFORCE ANY MANUFACTURER'S WARRANTIES ON BEHALF OF ITSELF OR LESSEE; (d) LESSOR HAS NOT INSPECTED AND IS NOT OBLIGATED TO INSPECT THE EQUIPMENT; (e) LESSOR LEASES THE EQUIPMENT TO LESSEE AS IS WITHOUT WARRANTY OR REPRESENTATION EITHER EXPRESS OR IMPLIED, AND THE LESSOR EXPRESSLY DISCLAIMS ANY WARRANTY, EXPRESS OR IMPLIED, AS TO (i) THE TITLE, CONDITION, FITNESS FOR USE FOR A PARTICULAR PURPOSE, DESIGN, COMPLIANCE WITH SPECIFICATIONS, OPERATION, OR MERCHANTABILITY THEREOF, (ii) THE ABSENCE OF LATENT OR OTHER DEFECTS, WHETHER OR NOT DISCERNABLE, (iii) THE ABSENCE OF INFRINGEMENT OF ANY PATENT, TRADEMARK OR COPYRIGHT OR (iv) ANY OTHER MATTER WHATSOEVER, IT BEING AGREED THAT ALL SUCH RISKS, AS BETWEEN THE LESSOR AND THE LESSEE, ARE TO BE BORNE BY THE LESSEE.
            		
            LESSEE FURTHER AGREES TO INDEMNIFY AND HOLD HARMLESS THE LESSOR FROM AND AGAINST ANY AND ALL CLAIMS, LIABILITIES (INCLUDING NEGLIGENCE, TORT AND STRICT LIABILITIES), DEMANDS, ACTIONS, SUITS AND PROCEEDINGS, LOSSES, COSTS, PENALITIES AND DAMAGES, INCLUDING WITHOUT LIMITATIONS, REASONABLE ATTORNEYS’ FEES AND COST (COLLECTIVELY “CLAIMS”), ARISING OUT OF, CONNECTED WITH, OR RESULTING FROM THE MANUFACTURE, SELECTION, PURCHASE, DELIVERY, POSSESSION, CONDITION, USE, OPERATION, HANDLING, TRANSPORTAION OR RETURN OF THE LEASED PROPERTY.
            GOVERNING LAW: THIS AGREEMENT SHALL BE INTERPRETED AND GOVERNED IN ACCORDANCE TO CALIFORNIA LAW. THE LESSEE AGREES THE VENUE TO BE RIVERSIDE COUNTY, CALIFORNIA.
            ARBITRATION: FOR PURPOSE OF RESOLVING DISPUTES: THE LESSOR AND LESSEE AGREE TO ARBITRATE THE MATTER. EACH PARTY WAIVES THE RIGHT TO A JURY TRIAL OR COURT TRIAL, THE SOLE AND EXCLUSIVE METHOD TO RESOLVE ANY CLAIMS IS ARBITRATION. THE PARTIES EACH WAIVE THEIR RIGHT TO COMMENCE AN ACTION IN ANY COURT TO RESOLVE A CLAIM. EXCEPT FOR AN ACTION FOR INJUNCTIVE RELIEF PENDING RESOLUTION OF A CLAIM PURSUANT TO THIS DISPUTE RESOLUTION PROCEDURE, NEITHER PARTY SHALL INITIATE OR PROSECUTE ANY LAWSUIT IN ANY WAY RELATED TO THE CLAIM. 
            		
            By Submitting your order you agree to these terms and conditions.
            		</textarea>
            		</label>
            		<br />
            		<label>
            		<input name="Acceptance" type="checkbox" id="CFAcceptance" value="Accepted" style="width:15px;" eform="Acceptance::1:" />
            		I Accept<br />
            		<em><strong><span style="color:#000000;">Please check box</span></strong></em>
            		</label>
                    <input name="Submit" type="submit" value="" class="submit-contact-main" id="submit-contact-main" />
                    </fieldset>
              </form>
            
            
              Faithfully using MODx since 2007!
              • 29181
              • 480 Posts
              The formid (ContactForm2) needs to be the same as the id you have taken in your template (contact-main) so that you can have more than one form on a page should you wish.

              Hope that solves your problem.

              Taff
                Adrian Lawley: www.adrianlawley.com
                • 30223
                • 1,010 Posts
                How about you read the documentation smiley The &format snippet parameter has been obsolete for several versions now... Your making yourself more work then necessary.

                For the rest,... Taff is right. Set the &formid parameter in the snippet call to `contact-main`
                  • 9941
                  • 65 Posts
                  Hey i’m using jQuery forms plugin to submit eForm using ajax... all works perfectly except validation. Can anyone point me in the right direction to extract the validation message and send it as the http response, rather than the response being to reload the page and merge the validation message with the placeholder?

                  If I manage to dig it out of the eform class file before someone gets to this, i’ll post it... and i’ll post some notes on AJAX eform setup using jQuery then as well (and add it to the wiki).

                  thanks all,


                    • 33372
                    • 1,611 Posts
                    @foniksonik: How have you set up your Ajax page? I would think that you could return the eForm page within an Ajax div as HTML or XML (although HTML would probably be easier). You should be able to use the validation placeholder as an XML value, but you could also add &$vMsg and &$rMsg to an event function so that you can check and manipulate the required and validation error messages that way.
                      "Things are not what they appear to be; nor are they otherwise." - Buddha

                      "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
                      • 9941
                      • 65 Posts
                      Quote from: ZAP at Oct 27, 2007, 10:38 AM

                      @foniksonik: How have you set up your Ajax page? I would think that you could return the eForm page within an Ajax div as HTML or XML (although HTML would probably be easier). You should be able to use the validation placeholder as an XML value, but you could also add &$vMsg and &$rMsg to an event function so that you can check and manipulate the required and validation error messages that way.

                      Hmmm the way I have it set up is that I use &gotoid=`166` to return a document with template set as blank... this is my success response and it gets set as the innerhtml of my ajax div target. I could use &thankyou= as well I believe if I wanted to also show form fields in the response but as far as validation goes and using the arrays you’ve mentioned... I’m not sure where to do that. eForm currently returns you to the form page and merges the errors into the placeholder.... my ajax call only has one target for response content, so I get a page within a page within a page.... browser hang and die ;-p

                      i don’t want to hack the ajax call as it is nicely generalized for a variety of uses...

                      What I am looking for is how to get &$vMsg and &$rMsg as a response in a nicely formatted string (html + text) if there is a validation error. Do I need to duplicate the validation message placeholder merge code in an event &eFormOnValidate function... then just return the result and stop everything else?

                      OR is there a better way to add a new parameter &Ajax=`1` where eForm does a switch and returns the validation as a string response rather than performing the document merge?








                      This discussion is closed to further replies. Keep calm and carry on.