We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25737
    • 62 Posts
    I get this error when trying to submit my form. I have upgraded to the latest version of eform and there are 2 forms on one page.

    « MODx Parse Error »
    MODx encountered the following error while attempting to parse the requested resource:
    « PHP Parse Error »
     
    PHP error debug
      Error: 	Invalid argument supplied for foreach()	 
      Error type/ Nr.: 	Warning - 2	 
      File: 	/home/8896/domains/easyonemortgages.com/html/assets/snippets/eform/eform.inc.php	 
      Line: 	810	 
      Line 810 source: 	foreach ($attributes as $k => $v) 	 
     
    Parser timing
      MySQL: 	0.0267 s	(7 Requests)
      PHP: 	0.0417 s	 
      Total: 	0.0685 s
      Faithfully using MODx since 2007!
    • Which version? What do your calls look like?
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 25737
        • 62 Posts
        This is my form:

        	<p class="error">[+validationmessage+]</p>
        		<form action="[~[*id*]~]" method="post" name="EmailForm"  >
        		<fieldset>
        		<input name="formid" type="hidden" value="HomeLoan" />
        		<label>* indicates a required field</label>
        		<label>First Name *:</label>
        		<input name="fname" type="text" value="" eform="Your First Name::1:" />
        		<br />
        		<label>Last Name *:</label>
        		<input name="lname" type="text" value="" eform="Your Last Name::1:" />
        		<br />
        		<label>Phone Number *:</label>
        		<input name="pnumber" type="text" value="" eform="Your Phone Number::1:" />
        		<br />
        		<label>Fax Number:</label>
        		<input name="fnumber" type="text" value="" />
        		<br />
        		<label>Email *:</label>
        		<input name="email" type="text" value="" eform="Your Email::1:" />
        		<br /> 
        		<label>State *:</label>
        		<select name="state" eform="State::1:">
        		<option selected="selected">Property Location</option>
        			<option value="AL">Alabama</option><option value="AK">Alaska</option><option value="AZ">Arizona</option><option value="AR">Arkansas</option><option value="CA">California</option><option value="CO">Colorado</option><option value="CT">Connecticut</option><option value="DE">Delaware</option><option value="DC">District of Columbia</option><option value="FL">Florida</option><option value="GA">Georgia</option><option value="HI">Hawaii</option><option value="ID">Idaho</option><option value="IL">Illinois</option><option value="IN">Indiana</option><option value="IA">Iowa</option><option value="KS">Kansas</option><option value="KY">Kentucky</option><option value="LA">Louisiana</option><option value="ME">Maine</option><option value="MD">Maryland</option><option value="MA">Massachusetts</option><option value="MI">Michigan</option><option value="MN">Minnesota</option><option value="MS">Mississippi</option><option value="MO">Missouri</option><option value="MT">Montana</option><option value="NE">Nebraska</option><option value="NV">Nevada</option><option value="NH">New Hampshire</option><option value="NJ">New Jersey</option><option value="NM">New Mexico</option><option value="NY">New York</option><option value="NC">North Carolina</option><option value="ND">North Dakota</option><option value="OH">Ohio</option><option value="OK">Oklahoma</option><option value="OR">Oregon</option><option value="PA">Pennsylvania</option><option value="RI">Rhode Island</option><option value="SC">South Carolina</option><option value="SD">South Dakota</option><option value="TN">Tennessee</option><option value="TX">Texas</option><option value="UT">Utah</option><option value="VT">Vermont</option><option value="VA">Virginia</option><option value="WA">Washington</option><option value="WV">West Virginia</option><option value="WI">Wisconsin</option><option value="WY">Wyoming</option>
        		</select>
        		<br />
        		<label>Loan Purpose *:</label>
        		<select name="loan-purpose" eform="Loan Purpose::1:">
                        <option value="0" Selected>-- Select --</option>
                        <option value="1"  >Home Purchase</option>
                        <option value="2"  >Home Refinance</option>
                        <option value="6"  >Home Equity</option>
                        <option value="7"  >Debt Consolidation</option>
                        <option value="3"  >Construction</option>
                      </select>
        		<br />
        		<label>Loan Amount *:</label>
        		<input name="loan-amount" type="text" value="" eform="Loan Amount::1:" />
        		<br />
        		<label>Property Value *:</label>
        		<input name="property-value" type="text" value="" eform="Property Value::1:" />
        		<br />
        		<label>Credit Rating *:</label>
        		<select name="credit-rating" eform="Credit Rating::1:">
                        <option value="0" selected>-- Select --</option>
                        <option value="1:Excellent">Excellent</option>
        				<option value="2:Good">Good</option>
                        <option value="4:Poor">Poor</option> 
                </select>
        		<br />
        		<label>Specialty Loan *:</label>
        		<select name="specialty-loan" eform="Specialty Loan::1:">
                        <option value="0">-- Select --</option>
                        <option value="1:FHA">FHA</option>
        				<option value="2:VA">VA</option>
                        <option value="3:Neither" selected>Neither</option> 
                </select>
        		<br />
        		<label>Loan Type *:</label>
        		<select name="loan-type" eform="Loan Type::1:">
                        <option VALUE="0"  >-- Loan Type --</option>
                        <option VALUE=1 Selected>30 Year Fixed Rate</option>
                        <option VALUE=2  >20 Year Fixed Rate</option>
                        <option VALUE=3  >15 Year Fixed Rate</option>
                        <option VALUE=5  >1 Year Adjustable Rate</option>
                        <option VALUE=6  >3 Year Adjustable Rate</option>
                        <option VALUE=7  >5 Year Adjustable Rate</option>
                        <option VALUE=8  >3/1 Adjustable Rate</option>
                        <option VALUE=9  >5/1 Adjustable Rate</option>
                        <option VALUE=10  >7/1 Adjustable Rate</option>
                        <option VALUE=11  >10/1 Adjustable Rate</option>
                        <option VALUE=12  >5/25 Balloon Program</option>
                        <option VALUE=13  >7/23 Balloon Program</option>
                        <option VALUE=14  >5/25 Two-Step Program</option>
                        <option VALUE=15  >7/23 Two-Step Program</option>
                </select>
        		<br />
        		<label>Point Range *:</label>
        		<select name="point-range" eform="Point Range::1:">
                        <option VALUE="0"  >-- Point Range --</option	>
                        <option VALUE=1  >Zero Points/Zero Costs</option>
                        <option VALUE=2 Selected>0 - 1</option>
                        <option VALUE=3  >1 - 2</option>
                        <option VALUE=4  >2 - 3</option>
                </select>
        		
        		<br />
        		<label>Contact Method *:</label>
        		<select name="contact-method" eform="Contact Method::1:">
        			<option value="Email">Email</option>
        			<option value="Phone">Phone</option>
        			<option value="Fax">Fax</option>
        		</select>
        		<br />
        		<label>Time *:</label>
        		<select name="contact-time" eform="Time::1:">
        			<option value="Email">Morning</option>
        			<option value="Phone">Afternoon</option>
        			<option value="Fax">Evening</option>
        			<option value="Fax">Anytime</option>
        		</select>
        		<br />
        		
        		<br />
        		<textarea name="message" onfocus="clearText(this)" onblur="replaceText(this)" rows="7" cols="15" eform="Message:textarea:1">Message</textarea>		
        		<br />
        		<input name="Submit" class="submit" type="submit" value="" id="cfContact" />
        		</fieldset>
        		</form>		
        


        This is the report for it:

        <p>Thank you for contacting easyonemortgages, you will be contacted by multiple lenders competing to offer you the lowest mortgage rate. Whether you're purchasing a new home, refinancing, or looking for a home equity loan, this process is simple, takes only a few minutes and puts the power of competitive bidding in your corner.</p>
        <p>The details of your message follow below:</p>
         
        <p>First Name: [+fname+]</p>
        <p>Last Name: [+lname+]</p>
        <p>Phone Number: [+pnumber+]</p>
        <p>Property Location: [+state+]</p>
        <p>Loan Purpose: [+loan-purpose+]</p>
        <p>Loan Amount: [+loan-amount+]</p>
        <p>Property Value: [+property-value+]</p>
        <p>Credit Rating: [+credit-rating+]</p>
        <p>Specialty Loan: [+specialty-loan+]</p>
        <p>Loan Type: [+loan-type+]</p>
        <p>Point Range: [+point-range+]</p>
        <p>Specialty Loan: [+point-range+]</p>
        <p>Fax Number: [+fnumber+]</p>
        <p>Email: [+email+]</p>
        <p>Preferred Contact Method: [+contact-method+]</p>
        <p>Preferred Contact Time: [+contact-time+]</p>
        <p>comments:<br />[+message+]</p>
        		 
        <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE: [+subject+]">[+email+]</a></p>
        <p>Powered by: <a href="http://www.easyonemortgages.com">Easy One Mortgages</a></p>


        This is how im calling it out:

        [!eForm? &formid=`HomeLoan` &report=`HomeLoanReport` &ccsender=`1` &to=`[email protected],[email protected]` &tpl=`HomeLoan` &category=`Home Loan Lead` &format=`fname:First Name:string:1,lname:Last Name:string:1,pnumber:Phone Number:string:1,contact-method:Contact Method:string:1,contact-time:Contact Time:string:1,state:Contact State:string:1,email:Email:email:1,loan-purpose:Loan Purpose:string:1,loan-amount:Loan Amount:string:1,property-value:Property Value:string:1,credit-rating:Credit Rating:string:1,specialty-loan:Specialty Loan:string:1,loan-type:Loan Type:string:1,point-range:Point Range:string:1,message:Message:html:1`!]


        Thank you.
          Faithfully using MODx since 2007!
        • That still does not tell us which version of eForm you’re using.
            Ryan Thrash, MODX Co-Founder
            Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
            • 30223
            • 1,010 Posts
            Make your form template (x)html compliant and speak to us again... eForm (any version) expect the form template to be proper html with attributes quoted.

            Also I’d suggest you read the eform documentation that you can find in the assets/snippets/eform/docs folder. You must have missed a few things while diligently reading because the &format parameter has been obsolete for quite a while. You should remove it.

            laugh
              • 25737
              • 62 Posts
              Version:
              # eForm 1.4.2 - Electronic Form Snippet
              # Original created by Raymond Irving 15-Dec-2004.
              # Version 1.3+ extended by Jelle Jager (TobyL) September 2006
                Faithfully using MODx since 2007!
                • 25737
                • 62 Posts
                Form is working. Thanks for the help.
                  Faithfully using MODx since 2007!