Landing page/form allowing empty required field submissions

Victor_Herrero
Level 4

Re: Landing page/form allowing empty required field submissions

So the required field function depends on javascript and if it is turned off or doesn't load for whatever reason, people are able to submit with empty required fields?

I'm having a similar issue myself. Leads are being created without email and I believe it has to do with a workaround I set up, to avoid "support" cases to fill out the business development contact us form

It's not a very elegant solution (because of my limited knowledge), but basically it does the following:

  1. The form has a boolean field at the start, upon which every other field is dependent: support case? yes / no
  2. If set to no, the rest is as usual. If set to yes, all fields get hidden by visibility rules, and only a text area is shown, with a link to our support center
    However, the submit button still shows (I had and still have no skills to use scripts to hide it, so that only the link to support shows)
  3. The rest of the fields are required, so I though people wouldn't be able to submit once they selected yes for support case, since required fields get hidden

It seems it can happen that people don't fill out anything, select support case, then hit submit

A lead is created with utm fields complete (because they are hidden and pre-filled), but no name, or email address (especially this one is weird)

Here is the landing page: Contact us: Can we help you? Please, tell us about your enquiry! | Fon

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page/form allowing empty required field submissions

When you use Visibility Rules, you're actually removing the fields from the form, not "hiding" them (despite the name). So fields that aren't shown aren't required. This makes sense, of course: there's no way a form could work otherwise.

To do what you want requires a line of JavaScript to validate that Support Case is not "yes" upon submission.

Victor_Herrero
Level 4

Re: Landing page/form allowing empty required field submissions

When you use Visibility Rules, you're actually removing the fields from the form, not "hiding" them (despite the name). So fields that aren't shown aren't required.

I didn't know about that, thanks! That would explain everything...

To do what you want requires a line of JavaScript to validate that Support Case is not "yes" upon submission.

Making it impossible for people to submit would help. If it's not too complex I might try to attempt it myself or ask for help with it.

I would rather just hide the submit button though, and leave a link for people to click on that redirects to the support center.

The purpose was to channel that kind of request to the right place automatically, as much as possible.

Thanks for the info and tips!

Grant_Booth
Level 10

Re: Landing page/form allowing empty required field submissions

Hi Victor,

If the Email Address is hidden on a Marketo form, it will always create a new lead if the person's browser isn't already cookied. I strongly recommend against ever using a Marketo form without the Email Address field visible.

To be honest, your use case doesn't sound like what Marketo was designed for. I would recommend using a different kind of form for submission of support cases - one that posts to whatever database you use for tracking support cases (SFDC Service Cloud, ZenDesk, etc.), so it creates a case record there.

Grant

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page/form allowing empty required field submissions

Victor's not allowing the case submissions, so that's okay (it's like when someone disables the Submit button for partners and suggests another means of contact).

Victor_Herrero
Level 4

Re: Landing page/form allowing empty required field submissions

Hi Grant, thanks for your suggestion.

As Sanford says, that form is not intended for support cases, but you know how angry people are...   They will go great lengths to file their complaint and make everyone aware of how disappointed they are

They will even file it in the "wrong window", as is the case with our business development contact us form

I just wanted to discourage support cases by hiding as much of the form as possible and redirecting to the support center, but since I didn't hide the submit button, I was getting incomplete records on my CRM

Grant_Booth
Level 10

Re: Landing page/form allowing empty required field submissions

Ahhh my misunderstanding, sorry about that. Good luck!

SanfordWhiteman
Level 10 - Community Moderator

Re: Landing page/form allowing empty required field submissions

And the JS is like so:

MktoForms2.whenReady(function(form){

  form.onSubmit(function(form){

    var currentValues = form.getValues();

    form.submittable(currentValues.contactussupport == "no");

  });

});

(Of course you'd need to coordinate this logic with other custom form logic, as applicable.)