We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ A M B ☆
    • 476 Posts
    So I’ve got a form on my site that is small (only 2 fields) and on every page. I want the ability to have people enter their information on the form and when they click submit, it will pass the values from those 2 fields over to a larger form designed by using eForm, but I can’t seem to pull that off. Here’s what I’ve done.

    Small form:
    	<form method="post" action="[~19~]">
    		<div class="sign_up_box_input">
    		<input class="sign_up_input" onfocus="if(this.value=='Please enter your email here.')this.value='';" onblur="if(this.value=='')this.value='Please enter your email here.';" type="text" name="email" value="Please enter your email here." />
    		<textarea class="sign_up_input comments" onfocus="if(this.value=='What can we do for you?')this.value='';" onblur="if(this.value=='')this.value='What can we do for you?';" name="message" rows="2" cols="20">What can we do for you?</textarea>
    		<input class="sign_up_botton" type="image" src="assets/templates/my619/layout/home/submit_button.jpg" name="submit" />
    		</div><!-- end .sign_up_box_input -->
    	</form>
    

    The eForm (on document 19) has this code:
    <form method="post" action="[~[*id*]~]" id="EmailForm" name="EmailForm">
    
    	<fieldset>
    		<h3> Contact Form</h3>
    
    		<input name="formid" type="hidden" value="ContactForm" />
    
    		<label for="cfName">Your name:
    		<input name="name" id="cfName" class="text" type="text" eform="Your Name::1:" /> </label>
    
    		<label for="cfEmail">Your Email Address:
    		<input name="email" id="cfEmail" class="text" value="[!GetSubmittedEmail!]" type="text" eform="Email Address:email:1" /> </label>
    
    		<label for="cfMessage">Message: 
    		<textarea name="message" value="[!GetSubmittedMessage!]" id="cfMessage" rows="4" cols="20" eform="Message:textarea:1"></textarea>
    		</label>
    
    		<label> </label><input type="submit" name="contact" id="cfContact" class="button" value="Send This Message" />
    
    	</fieldset>
    
    </form>
    

    And the snippets I’m using in the eForm are here:

    [!GetSubmittedMessage!]
    <?php
    return $_POST['message'];
    ?>
    

    [!GetSubmittedEmail!]
    <?php
    return $_POST['email'];
    ?>

    When they arrive on the page with the larger form, none of the values passed over from the smaller form show up.

    Anyone had any experience pulling this off?

    Thanks!
      Precision Web Development ... SmashStack.com
      • 813 ☆ A M B ☆
      • 326 Posts
      Any luck getting this to work? I’m trying to do something similar.
        • 33982 ☆ A M B ☆
        • 476 Posts
        Unfortunately no...let me know if you find anything out wink
          Precision Web Development ... SmashStack.com
          • 3749
          • 24,544 Posts
          Have you tried it without the onclick() and onblur() calls?
            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
            • 33982 ☆ A M B ☆
            • 476 Posts
            Have you tried it without the onclick() and onblur() calls?

            Yes I have...I probably should have removed that from the original post b/c it’s a bit cluttering, but even with simple forms posting to eForm, I can’t get it to work.
              Precision Web Development ... SmashStack.com
              • 3749
              • 24,544 Posts
              I guess the next thing would be to try your code outside of eForm. I don’t see anything wrong with it.
                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