SOLVED

Re: changing value of marketo form before submit

Go to solution
dondmcg
Level 2

Re: changing value of marketo form before submit

Search for id: "phi_dateOfBirth"

and id: "phi_ReferringPhysicianPhone"

Are you saying neither of these fields have a marketo mask on them?

 

Also does this require adding jquery.mask.js ?

SanfordWhiteman
Level 10 - Community Moderator

Re: changing value of marketo form before submit

They don't have masks because you didn't set masks in Form Editor. You never need to manually include the plugin. Marketo includes it automatically when necessary.

dondmcg
Level 2

Re: changing value of marketo form before submit

The form editor is set up by another team.  But I specifically asked them to set up those two masks.  And I see the validation occurring so I tend to think they are set up.   There is only masks on two of the inputs.  However I am contacting that team to verify.  

dondmcg
Level 2

Re: changing value of marketo form before submit

So this line seems to be the problem:

form.getFormElem().find('[name=' + k + ']').unmask();
it errors out saying unmask() is not a function
but if I alter the code to be this:
form.getFormElem().find('[name=' + k + ']').hide();
all the elements are hidden and I get no error.
 
If I look at: MktoForms2.$. there is NO mask method available.
Likewise when I look at window.jQuery there is no mask method available either. Which makes sense as the plugin is not installed.

 

SanfordWhiteman
Level 10 - Community Moderator

Re: changing value of marketo form before submit

Of course, the plugin is only included if you have at least one masked input. Which you don't...