Required Checkbox Field Not Validating

Anonymous
Not applicable

Required Checkbox Field Not Validating

Hi All,

We are using a checkbox field that is required on the Marketo form to validate that the privacy policy is understood and agreed. However, we are finding that the form is consistantly submitted without this field populated. I have used the below community solution with no avail.

https://community.marketo.com/MarketoArticle?id=kA050000000KyxoCAC

Has anyone had this issue who can recommend a solution?

Cheers,
Brit
Tags (1)
7 REPLIES 7
Josh_Hill13
Level 10 - Champion Alumni

Re: Required Checkbox Field Not Validating

Are those leads who are not submitting the field real leads? You might have spam bots.

Or your leads have javascript disabled.
Anonymous
Not applicable

Re: Required Checkbox Field Not Validating

Think about it, though; a checkbox field is true or false.  Empty/null/0 is false.  So they're not submitting it without it being populated, it's being submitted as unchecked.
Anonymous
Not applicable

Re: Required Checkbox Field Not Validating

Josh is correct.  You most likely have people and/or bots that are not processing javascript.  To test the theory, add a hidden field to the form and ONLY populate the form with some javascript code. i.e. set a value or have a default and clear a value. Then in marketo test for the valid condition and reject any form submition that does not have your validation set.

Of course you could change to an serverside approach and do it all yourselft that way you can reject the visitor's submit before it hits the database.

Hope this helps
Eric
Anonymous
Not applicable

Re: Required Checkbox Field Not Validating

I have a checkbox which is configured to be required in the Form builder.  However I can't get the Marketo's function
Mkto.formSubmit(elt)
to validate the checkbox field when the form is subitted.  The same form has other text fields and pulldownn fields and they are validated by Marketo's Javascript, just not the checkbox.

Is this a Marketo bug?

Is there a similar Marketo function that would validate all the required fields that are configured in the Form builder, but would return a True or False, instead of submitting the form if all the required fields are validated?  Something like the following function (I am suggesting)

// Is there a Marketo function like the following?
Mkto.validateForm(elt)



Anonymous
Not applicable

Re: Required Checkbox Field Not Validating

I have the same issue - checkbox is marked as a required field, but is accepted without being checked.

It's not a bot -- I'm able to replicate the behavior using a browser (with javascript).
Anonymous
Not applicable

Re: Required Checkbox Field Not Validating

any solution to this?  or do we have write the validation ourselves?
Anonymous
Not applicable

Re: Required Checkbox Field Not Validating

I am looking for a solution to this too. Should we change the checkbox to a yes/no drop down?