3

I am using FreeForm PRO with EE 2.6.1. I have a form that I only want submitted if the author agrees to the terms and conditions by checking the box. I tried to make it a required field, but that did not work.

Any help would be appreciate.

2 Answers 2

2

I don't have a copy of Freeform Pro on hand, so I don't have the checkbox fieldtype, but with the free version of 4 I was able to accomplish this with the following:

  1. I created a field for the checkbox as a text input named "terms" and attached it to my form
  2. I added the required="terms" parameter to my {exp:freeform:form} tag.
  3. I added a checkbox input with the name="terms" parameter inside my {exp:freeform:form} tag and set it's value to true.

Upon submission, if the checkbox is unchecked it fails as you would expect, and when it is checked it succeeds.

0

What Diemer said above will work, but for a better user experience you will probably want to use some jquery to validate the form. Personally I like Parsley.js for this sort of thing and is very simple to use.

You'll also want to add the required="checkbox_field_name" parameter to your freeform tags just as a backup measure.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.