0

first post here. For what I understand, I need to add 'data-parsley-validate' to the form tag and 'required' and some other options for the fields.

I have been using Composer but even if I can define the special parameters using template approach (where I manually code the fields) the tag will require the Parsley parameter.

Is this something we can add to the FreeForm Pro form tag? Or what about adding parameters for the fields using the Composer option?

Thanks for your time

0

You could try:

{exp:freeform:form form:data-parsley-validate="true"}

But from memory there is a bit notice on the Parsley docs that says NOT to add the data-parsley-validate attribute manually.

You should create some javascript/jQuery to attach the validation behaviour to your form. Maybe give the Freeform tag an id or class attribute and then get your jQuery to target that.

{exp:freeform:form form:class="validate-me"}

and then some jQuery (at the bottom of the template

$('.validate-me').parsley();

You can then provide data attributes on each form input (if you're manually coding the form) or you can set up validation options within the jQuery.

  • That sounds logic. And if the theory is correct that should work on the Composer forms as well. I got away for now by manually coding the main fields but will try this approach with another form(composer). Also, I guess that there is no way to add custom properties to fields from composer right? Thanks again for your help. – avazquez Aug 8 '14 at 19:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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