Hi I am trying to create a sequential form by using two differnt forms. I would like to use the forms 2.0 api to do so. I have this so far...Can you grab an id or another form with in another one?
Hi,
have you find the answer ?
thanks
This should be consolidated with Two Part Form Submittal to avoid confusion since there's working code over there. Maybe John Wallace will mark this one as solved/closed.
I ran into an issue like this as well but I needed two completely different forms on the page at the same time. On submit they would do two different actions.
Issue I had was no matter which form was submitted it would do both completion actions.
My solution was simple and may help people having a similar issue.
MktoForms2.loadForm("//app-ab10.marketo.com", "730-NST-988", 6961);
MktoForms2.loadForm("//app-ab10.marketo.com", "730-NST-988", 6958);
MktoForms2.whenReady(function(form) {
form.onSuccess(function(values, followUpUrl) {
form.getFormElem().hide();
if(form.getId() == '6961') {
/* Actions for form one (6961) here */
} else {
/* Actions for form two (6958) here */
}
return false;
});
});
Yep, that's one way to do it!
You can also check the ID before adding a listener.