PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Populating one form from another on the same page

  1. Hi,
    I read through this post but I didnt quite figure it out:
    http://www.gravityhelp.com/forums/topic/populating-from-a-previous-form

    On this page:
    http://launch0812pre.stablish.me/
    I have 4 Forms: 1x Register your email (header), 1x Register your email (footer), and 2x invite friends (header/footer)
    After you register your email, you should be able to invite 5 friends.
    My problem is, I donno who filled out the second form.
    I would like the invite friends form to have a hidden field, that is populated from the input in the first form (emailadress of visitor), but without a page reload. Like this I should be able to see who invited whom...
    I guess this cannot be 2 hard, since all the forms are already on the screen (display:none) when the page is loaded. I think the solution would be some JS, but I have no idea how or where to start. Any help, or pointers in the right direction are appreciated.

    Posted 12 years ago on Monday July 16, 2012 | Permalink
  2. Please see this post from David Smith.
    http://www.gravityhelp.com/forums/topic/dynamically-populate-addresses#post-61431

    You can use jQuery to populate one form field on a page with the value from another form field which has already been completed. I suspect that's what David has done here.

    Alternately, you can search for "shipping address same as billing address" and similar posts and see various solutions utilizing jQuery or JavaScript.

    Posted 12 years ago on Tuesday July 17, 2012 | Permalink
  3. This is what I was looking for:

    [js]
    		$('#input_5_1').keyup(function () {
    			$('#input_4_6').val(this.value);
    		});
    		$('#input_6_1').keyup(function () {
    			$('#input_7_6').val(this.value);
    		});

    Hope this helps someone else. It populates the field 6 in form 4 from the value in form 5 field 1, and the same for form 6 and 7.

    Posted 12 years ago on Tuesday July 17, 2012 | Permalink
  4. That will do it. Thanks for the post.

    Posted 12 years ago on Tuesday July 17, 2012 | Permalink

This topic has been resolved and has been closed to new replies.