We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    Does anyone know what this means?
    « 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:	/home7/lousdeco/public_html/assets/snippets/eform/eform.inc.php	 
      Line:	843	 
      Line 843 source:	 foreach ($attributes as $k => $v)	 
     
    Parser timing
      MySQL:	0.0036 s	(5 Requests)
      PHP:	0.0661 s	 
      Total:	0.0697 s

      The MODx has you...
      Utah Web Design
      • 21561
      • 16 Posts
      Can you post your snippet call with templates and any other snippets you are using with the call.
        • 30223
        • 1,010 Posts
        Probably caused by an input/select/textarea element with no attributes defined in your form template.
          • 4749
          • 623 Posts
          Here’s the call:
          [!eForm? &formid=`Diamond` &subject=`[+subject+]` &to=`[(email_sender)],[email protected]` &ccsender=`1` &tpl=`Diamond` &from=`[email protected]` &report=`packageReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &gotoid=`9` &vericode=`1` &css=`ContactStyles`!]


          Here’s the template:
           <div class="form-container">
          <p><span style="color:#900;">[+validationmessage+]</span></p>
          
          <form method="post" action="[~[*id*]~]" >
          	<input type="hidden" name="formid" value="Diamond" id="Diamond" />
                  <p class="legend"><strong>Note:</strong> Required fields are marked with an asterisk (<em>*</em>)</p>
          	<fieldset>
          		<legend>Contact Information</legend>
          			<div><label for="name">Name <em>*</em></label> <input type="text" name="firstname" size="30" maxlength="60" eform="Name:name:1" /></div>
          			<div><label for="phone">Phone <em></em></label> <input type="text" name="phone" size="30" maxlength="40" eform="Phone:phone:1" /></div>
          	</fieldset>
          
          	<fieldset>
          	<legend>Requested Date:</legend>
          		<select name="Month">
          			<option value = "January">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>
          		
          		<select name="Day">
          			<option value = "1">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>
          		
          		<select name="Year">
          			<option value = "2009">2009</option>
          			<option value = "2010">2010</option>
          		</select>
          		
          		
          	</fieldset>
          
          	<fieldset>	
          		<legend>Comments</legend>
          		<div><textarea cols="40" rows="5" name="comments" eform="comments:html:1"></textarea></div>
          	</fieldset>
          
                 <fieldset>
          		<legend>Enter code to eliminate spam:</legend>
          			<img src="[+verimageurl+]" alt="verification code"  class="code-image" /> <div class="clearer"></div>
          			<div class="code-input"><input type="text" name="vericode" size="20" /></div>
          	</fieldset>
          	
          	<div class="buttonrow">
          		<input class="verify" type="submit" name="Submit" value="Send Feedback">
          	</div>
          </form>
          </div>


          EDIT: There were spaces in the date values when I copy/pasted - oops!
            The MODx has you...
            Utah Web Design
            • 30223
            • 1,010 Posts
            Ah well,... happens to us all smiley Just as well you got this error message then.

            I’m assuming everything is ok now?
              • 4749
              • 623 Posts
              Yes, all is well. Too bad I had to open my mouth before I realized what had happened. LOL. laugh
                The MODx has you...
                Utah Web Design