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!
Solved! Go to Solution.
The TEKNKL Pre-Fill library doesn't overwrite window.mktoPreFillFields. It uses a JS object that exists only inside the cb (callback) function.
Add your code above inside the cb if you want it to depend on the contents of mktoFields.
The TEKNKL Pre-Fill library doesn't overwrite window.mktoPreFillFields. It uses a JS object that exists only inside the cb (callback) function.
Add your code above inside the cb if you want it to depend on the contents of mktoFields.
Thanks for the quick response Sanford. I have assigned values to mktoPreFillFields and then things worked as expected.