SOLVED

Submitting two forms with one submit button

Go to solution
remyburnaugh
Level 1

Submitting two forms with one submit button

Hello all,

 I'm attempting to set up a referral form and having a tough time doing so. 

 

I first tried using the information from this forum post: https://nation.marketo.com/t5/product-discussions/referral-form-with-multiple-referrals/m-p/122260#M...

 

No luck. I'm afraid I don't know JS well enough to implement the above. 

 

So, I'm hoping to create two forms on one page, using CSS to hide the submit button on the first (the referrer) and have the submit button on the second (the referee) input both leads, separately into the system. Then, I'll figure out the attribution on the backend. Has anyone tried this with any success? 

 

A HUGE thank you to anyone that is able to assist. 

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Submitting two forms with one submit button

You don’t need 2 visible forms. It’s just more complexity to hide the Submit button on one of them.

 

To know who referred whom, and who was referred by whom — valuable info! — you use fields like Originally Referred By Email Address (to be used on the referral) and Last Referral Email Address (to be used on the referrer, who of course can also be a previous referral).

 

So you have one visible form that you submit on behalf of the referrer, and then another hidden one you submit on behalf of the referral. In the onSuccess of the visible one, you setValues() the right field values in the hidden one, then run form.submit() for the hidden one.

View solution in original post

2 REPLIES 2
Darshil_Shah1
Level 10 - Community Advisor

Re: Submitting two forms with one submit button

@remyburnaugh , instead of creating 2 forms for this, create a single form and add the JS for setting up the referral form. I'm sure the community would be more than happy to help you fix the issue in case you get into a rut. Additionally, there are plenty of threads already on referral form setup posted and discussed on this topic in the community.

SanfordWhiteman
Level 10 - Community Moderator

Re: Submitting two forms with one submit button

You don’t need 2 visible forms. It’s just more complexity to hide the Submit button on one of them.

 

To know who referred whom, and who was referred by whom — valuable info! — you use fields like Originally Referred By Email Address (to be used on the referral) and Last Referral Email Address (to be used on the referrer, who of course can also be a previous referral).

 

So you have one visible form that you submit on behalf of the referrer, and then another hidden one you submit on behalf of the referral. In the onSuccess of the visible one, you setValues() the right field values in the hidden one, then run form.submit() for the hidden one.