Question
How to load 2 different forms in sequential order with Javascript
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?
<script src="//app-sjp.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_333"></form>
<script>
MktoForms2.loadForm("//app-sjp.marketo.com", "466-AGZ-592", 333, function(form) {
form.onSuccess(function(callback) {
form.getFormElem().hide();
//want to show the from below after submit
});
});
</script>
<!-- second form -->
<script src="//app-sjp.marketo.com/js/forms2/js/forms2.js"></script>
<form id="mktoForm_334"></form>
<script>MktoForms2.loadForm("//app-sjp.marketo.com", "466-AGZ-592", 334, function(form) {
form.getFormElem().hide();
});
</script>
Once the first from is submitted I would like to load the other one. I know I have been bugging people but would like to avoid building multiple landing pages to create a seemless sequential form. Would I need to use ajax to submit the first form then load the second one? Thanks in advance
-John