Marketo Forms pre-fill when there are two forms in the same page
We have two Marketo forms in a single page and display of forms will be controlled based on mktoPreFillFields, something like this
MktoForms2.whenReady(function (form){
if(typeof mktoPreFillFields != "undefined" && !jQuery.isEmptyObject(mktoPreFillFields)){
/* Show form2 and hide form 1 */
}
}
With the new Marketo Form Pre-fill Feature upgrade we had to use Sanford Whiteman's solution for Pre-fill of forms. Unfortunately Pre-fill of forms is happening after the above function is executed and only form1 is getting displayed every time. As there are two MktoForms2.whenReady() functions , is there a way to control the flow between the two like pre-fill executes first and then the above one?
Any suggestions are welcome. Thanks in advance!