SOLVED

Re: Turn off field validation for a specific form

Go to solution
tmoi
Level 2

Turn off field validation for a specific form

I'm working on an invalid email notification system for local Marketo users, so they would be notified if a record with an invalid email address is created and preferably they need to take action and fix it in Marketo otherwise the record gets deleted after 2 weeks (with many reminders). However, in the alert email I send them, I would like to keep the option for them to mark the record "OK for deletion" right away, so if they click on this link they are redirected to an LP created for this purpose.

 

On the LP, I prefilled the hidden email field from the URL (?Email=example), but here comes the part I couldn't get through:

 

So these email addresses are mostly broken (eg: asd@@examlpe;;com). This prepopulated value pops up an "invalid input" error message on the page (which it normally should), but in this case, I need these records to "go through"  the form submission process and get marked with "OK to be deleted". I tried doing this with lead ID, but submitting the form with the ID alone did not create an activity for the record.

 

Any ideas how to absolve this or if anyone have a better idea I'm all ears! Thank you a lot!

2 ACCEPTED SOLUTIONS

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Turn off field validation for a specific form

First of all, you can’t just add the {{lead.Email Address}} in the URL. This is itself is unsafe. You should be using a Velocity script that outputs the link:

 

<a href="https://www.example.com/email=${link.encode($lead.Email)}">click here</a>

 

 

As far as bypassing JS validation, just use a Text type field instead of Email type. EDIT: new server-side validation prevents this from working. See my later replies for a workaround.

View solution in original post

SanfordWhiteman
Level 10 - Community Moderator

Re: Turn off field validation for a specific form

Hmm, you’re right. This is a recently added server-side validation (when you’ve been working with the forms lib for so long, you forget some things were added).

 

However, it’s basically a bug: this makes it impossible for someone to submit an updated email address in a proxy field, since the primary Email Address field will fail to validate. And then there’s your situation.

 

There’s pretty straightforward workaround: use a mkt_tok-enized link in the Send Alert, and don’t include the Email Address field on the form in any way. Normally, an alert doesn’t include tracked links, which is appropriate since you don’t want to accidentally associate a salesperson’s Munchkin session with the Marketo person.  But if you add the query param mkt_tok=##MKT_TOK## to the link, it’ll then be capable of associating the form data with the Marketo person without including the problematic email itself. And you can still include the email address in another query param and display it on the page body, you just don’t copy it to a form field.

View solution in original post

5 REPLIES 5
Travis_Schwartz
Level 4

Re: Turn off field validation for a specific form

Would creating a proxy email field that is populated instead of the actual email field work?

SanfordWhiteman
Level 10 - Community Moderator

Re: Turn off field validation for a specific form

First of all, you can’t just add the {{lead.Email Address}} in the URL. This is itself is unsafe. You should be using a Velocity script that outputs the link:

 

<a href="https://www.example.com/email=${link.encode($lead.Email)}">click here</a>

 

 

As far as bypassing JS validation, just use a Text type field instead of Email type. EDIT: new server-side validation prevents this from working. See my later replies for a workaround.

tmoi
Level 2

Re: Turn off field validation for a specific form

Thanks Sanford, will use the encoding from now on.

 

Changing the field type itself won't solve the issue if I'm using the Email Address field in my Marketo form (tried with hidden, text, text area), the original error message still pops up (again, as it should as these values are broken), but I need to use the email address in my form as I can only update them based on that (right?)

 

So the issue still stands, is it possible to push these records through the form submission and update their profile? I'm running out of sensible ideas.

 

Thanks a lot folks!

SanfordWhiteman
Level 10 - Community Moderator

Re: Turn off field validation for a specific form

Hmm, you’re right. This is a recently added server-side validation (when you’ve been working with the forms lib for so long, you forget some things were added).

 

However, it’s basically a bug: this makes it impossible for someone to submit an updated email address in a proxy field, since the primary Email Address field will fail to validate. And then there’s your situation.

 

There’s pretty straightforward workaround: use a mkt_tok-enized link in the Send Alert, and don’t include the Email Address field on the form in any way. Normally, an alert doesn’t include tracked links, which is appropriate since you don’t want to accidentally associate a salesperson’s Munchkin session with the Marketo person.  But if you add the query param mkt_tok=##MKT_TOK## to the link, it’ll then be capable of associating the form data with the Marketo person without including the problematic email itself. And you can still include the email address in another query param and display it on the page body, you just don’t copy it to a form field.

tmoi
Level 2

Re: Turn off field validation for a specific form

And this workaround works perfectly! Thanks a lot, Sanford!