We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    I have two forms on the same page. One is for contact information and the other is a request for proposal. The first contact form works great - tested just fine. The request for proposal is not pulling up the captcha codes and won’t process. I feel like I’ve been staring at this for too long and need a fresh set of eyes to find what I’m missing. Below is all the code associated with the forms.

    Here is the first form, it works great.
    <div class="form-container">
    <p><span style="color:#900;">[+validationmessage+]</span></p>
    
    <form method="post" action="[~[*id*]~]" >
    	<input type="hidden" name="formid" value="ContactForm" id="ContactForm" />
            <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="name" size="30" maxlength="60" eform="Name::1" /></div>
    			<div><label for="email">Email <em>*</em></label> <input type="text" name="email" size="30" maxlength="40" eform="Email:email:1" /></div>
    	</fieldset>
    
    	<fieldset>
    	<legend>Subject</legend>
    		<select name="subject">
    			<option value="General Information">General Information</option>
    			<option value="Feedback">Website Feedback</option>
    			<option value="Request">Request a Bid</option>
    			<option value="Other">Other</option>
    		</select>
    	</fieldset>
    
    	<fieldset>	
    		<legend>Comments</legend>
    		<div><textarea cols="40" rows="10" 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="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>


    and the eform code:
    [!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[email protected],[(email_sender)]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`9` &vericode=`1` !]



    This is the second non-working form:
    		<div class="form-container">
    
    			<p><span style="color:#900;"></span></p>
    				<form id="proposalform" method="post" action="[~[*id*]~]" >
    			<input type="hidden" name="formid" value="proposalform"  id="proposalform" />
    			<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 id="name" type="text" name="name" size="30" eform="Name::1" /></div>
    					<div><label for="email">Email <em>*</em></label> <input id="email" type="text" name="email" value="" size="30" eform="Email:email:1" /></div>
    					<div><label for="company">Company </label> <input id="company" type="text" name="company" value="" size="30"  eform="Company:company:1"/></div>
    					<div><label for="website">Website </label> <input id="website" type="text" name="website" value="http://" size="30" maxlength="40" eform="Website:website:1" /></div>
    			</fieldset>
    			
    			<fieldset>
    				<legend>Services Needed</legend>
    				<div id="checkboxes">
    				<input id="webTog" type="checkbox" name="service" value="webstuff" />Web
    				<input id="printTog" type="checkbox" name="service" value="printstuff" />Print
    				<input id="mediaTog" type="checkbox" name="service" value="mediastuff" />Multimedia				</div>
    			</fieldset>
    			
    			
    			<fieldset id="web1">
    				<legend>Web</legend>
    					<label for="type">Type:</label> 
    						<select id="type" name="type" >
    							<option value="Web Design">Web Design</option>
    							<option value="Design & Programming">Web Design & Programming</option>
    						</select><br />
    
    					<label for="scope">Scope:</label> 
    						<select id="scope" name="scope" >
    							<option value="1-3">1-3 pages</option>
    							<option value="3-6">3-6 pages</option>
    							<option value="6-10">6-10 pages</option>
    							<option value="11-15">11-15 pages</option>
    							<option value="16-20">16-20 pages</option>
    							<option value="21-30">21-30 pages</option>
    							<option value="31-50">31-50 pages</option>
    							<option value="50+">50+</option>
    						</select><br />
    
    					<label for="timeline">Timeline:</label> 
    						<select id="webtimeline" name="webtimeline" >
    							<option value="ASAP">ASAP</option>
    							<option value="2-4 Weeks">2-4 Weeks</option>
    							<option value="1-2 Months">1-2 Months</option>
    							<option value="2-4 Months">2-4 Months</option>
    							<option value="4+ Months">4+ Months</option>
    						</select><br />
    
    					<label for="budget">Budget:</label> 
    						<select id="webbudget" name="webbudget" >
    							<option value="$2500 - $5000">$2,500 - $5,000</option>
    							<option value="$5000 - $7500">$5,000 - $7,500</option>
    							<option value="$7500 - $10,000">$7,500 - $10,000</option>
    							<option value="$10,000 - $20,000">$10,000 - $20,000</option>
    							<option value="$20,000 - $50,000">$20,000 - $50,000</option>
    							<option value="$50,000+">$50,000+</option>
    						</select>
    			</fieldset>
    
    
    			<fieldset id="print1">
    				<legend>Print</legend>
    					<label for="printservice">Type:</label> 
    						<select id="printservice" name="printservice" class="select_field">
    							<option value="Product Packaging">Product Packaging</option>
    							<option value="Stationery/Business Cards">Stationery/Business Cards</option>
    							<option value="Flyers">Flyers</option>
    							<option value="Misc.">Misc.</option>
    						</select><br />
    						
    					<label for="printtimeline">Timeline:</label> 
    						<select id="printtimeline" name="printtimeline" class="select_field">
    							<option value="ASAP">ASAP</option>
    							<option value="1-2 Weeks">1-2 Weeks</option>
    							<option value="2+ Weeks">2+ Weeks</option>
    						</select>
    			</fieldset>
    			
    			<fieldset id="media1">
    				<legend>Multimedia</legend>
    					<label for="mediaservice">Type:</label> 
    						<select id="mediaservice" name="mediaservice" class="select_field">
    							<option value="Corporate Video">Corporate Video</option>
    							<option value="Presentation">Presentation</option>
    							<option value="Animation">Animation</option>
    							<option value="Other">Other</option>
    						</select><br />
    
    					<label for="mediatimeline">Timeline:</label> 
    						<select id="mediatimeline" name="mediatimeline" class="select_field">
    							<option value="ASAP">ASAP</option>
    							<option value="1-2 Months">1-2 Months</option>
    							<option value="2-4 Months">2-4 Months</option>
    							<option value="4+ Months">4+ Months</option>
    						</select><br />
    
    					<label for="mediabudget">Budget:</label> 
    						<select id="mediabudget" name="mediabudget" class="select_field" >
    							<option value="$7500 - $10,000">$7,500 - $10,000</option>
    							<option value="$10,000 - $20,000">$10,000 - $20,000</option>
    							<option value="$20,000 - $50,000">$20,000 - $50,000</option>
    							<option value="$50,000+">$50,000+</option>
    						</select>
    			</fieldset>
    			
    			<fieldset>
    				<legend>Project Description:</legend>
    					<textarea cols="40" rows="10" name="description" eform="description:html:1"></textarea>
    			</fieldset>
                            <fieldset>
    	                  <legend>Enter code to eliminate spam:</legend>
    	                        <img src="[+verimageurl+]" alt="verification code" class="code-image" />
    	                        <div class="code-input" ><input type="text" name="vericode" size="20" /></div>
    	                 </fieldset>
    			
    			<div class="buttonrow">
    				<input type="submit" name="Submit" value="Submit Request">
    			</div>
    
    			</form>
    		</div><!-- /form-container -->


    and the second form’s eform code:
    [!eForm? &formid=`proposalform` &subject=`[+subject+]` &to=`[email protected],[(email_sender)]` &ccsender=`1` &tpl=`proposalform` &report=`proposalReport` &invalidClass=`invalidValue` &requiredClass=`requiredValue` &cssStyle=`ContactStyles` &gotoid=`9` &vericode=`1` !]

      The MODx has you...
      Utah Web Design
      • 4310
      • 2,310 Posts
      I’m sure I read a thread elsewhere of problems with trying to use vericode twice on a page.
      Have you tried not using it on the second form?
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        The value of the vericode that is generated is saved in the SESSION, then this is compared with the user’s input. I suspect that the vericode code doesn’t change that value if it already exists, which is why the second form doesn’t work; it’s generating a new vericode, but the original value is still in the SESSION. What happens if you enter the first form’s vericode into the second one’s field?
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 4749
          • 623 Posts
          Well, I thought about the sessions problem but I looked in the source and copied in that session and they were both working, but that ’s not a feasible solution. Is there any way to have one vericode for both forms then? Or can I use a predetermined qualifier ( The sun is hot. True or False.) Then they’d have to enter True to be able to submit the form.

          Thanks for the suggestions.

          UPDATE: I took out the vericode stuff and now the second form isn’t sending. I’m just getting a page reload.
            The MODx has you...
            Utah Web Design
            • 3749
            • 24,544 Posts
            If your problem is really with the Vericode function (and it’s not clear that it is), you could make a second copy of the vericode file (call it vericode2). Modify the code in that file to have it use a different SESSION variable (veriword2). Call vericode2 for the second form and it shouldn’t conflict with the first one.

            Bob
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting
              • 4749
              • 623 Posts
              Yeah, you’re right. At this point I don’t know what’s going on. The second form is still not sending - with or without the vericode. So, I’m stumped I’ve checked everything and still can’t figure out why this isn’t working. I know that eForm can handle two forms on a page I’m just not sure why it won’t do it here.
                The MODx has you...
                Utah Web Design