Has anyone else found that this code does not work on IE 9 and below? Works fine in IE 10 & 11 but won't allow form submit no matter what the email address is in IE 9. Was also wondering if anyone has altered the Marketo supplied script for form validation (#9 on here -http://developers.marketo.com/documentation/websites/forms-2-0/) to work for Email address and would care to share. I haven't seen it out in the Community yet. Time to go brush up on my js knowledge...
MktoForms2 . loadForm ( "//app-sjqe.marketo.com" , "718-GIV-198" , 621 , function ( form ){
//listen for the submit event
form . onSubmit ( function (){
//get the values
var vals = form . getValues ();
//Check your condition
if ( vals . Country == "USA" && vals . VehicleSize != "massive" ){
//prevent form submission
form . submitable ( false );
//Show error message, pointed at VehicleSize element
var vehicleSizeElem = form . getFormElem (). find ( "#VehicleSize" );
form . showErrorMessage ( "All Americans must have a massive vehicle" , vehicleSizeElem );
} else {
//enable submission for those who met the criteria.
form . submitable ( true );
}
});
});
... View more