SOLVED

Marketo form custom validation in backend

Go to solution
yaseen_sm
Level 1

Marketo form custom validation in backend

Hello sir,

I want to set up a custom validation for form. Currently, we are using that validation code on the template page but I need to move that code in form backend side so it will work for every page wherever I have used that form. Where can I upload that code on the backend side? 

Give an example. Like I want to restrict the user to enter the @gmail account while filling the form. How can I do it Marketo level instead of form or page level?

1 ACCEPTED SOLUTION

Accepted Solutions
Harish_Gupta6
Level 8

Re: Marketo form custom validation in backend

Unfortunately No. You need to add it either on each form level in Rich text or add it to the lp template. 😞 

 

There is one idea but I never tried this 🙂 

 

You can create a RICH text token and add the script in it. And then use the token on the LP template or when anyone tries to create the page then add the token in the custom head. 

 

Thanks

 

 

Harish Gupta

View solution in original post

4 REPLIES 4
Harish_Gupta6
Level 8

Re: Marketo form custom validation in backend

In your form in Marketo, use RICH TEXT and then click on the HTML icon and add your script.

 

Harish_Gupta6_0-1595587999138.png

 

 

Harish_Gupta6_1-1595588026346.pngHarish_Gupta6_2-1595588052140.png

 

Harish Gupta
yaseen_sm
Level 1

Re: Marketo form custom validation in backend

Thanks for the reply. I have one more query.

I have a lot of forms for different Marketo pages. So, Is there any way to upload the script only once that it will execute for every form?

Harish_Gupta6
Level 8

Re: Marketo form custom validation in backend

Unfortunately No. You need to add it either on each form level in Rich text or add it to the lp template. 😞 

 

There is one idea but I never tried this 🙂 

 

You can create a RICH text token and add the script in it. And then use the token on the LP template or when anyone tries to create the page then add the token in the custom head. 

 

Thanks

 

 

Harish Gupta
SanfordWhiteman
Level 10 - Community Moderator

Re: Marketo form custom validation in backend

Adding custom JS behaviors via a Rich Text area isn't as simple as just pasting the script. There's an additional, critical step, as detailed in this blog post: https://nation.marketo.com/t5/Product-Blogs/HOWTO-Add-Forms-2-0-JS-behaviors-inside-a-Rich-Text-Area...