I am relatively new to Craft CMS and have been using the formBuilder2 plugin to create forms. No problem this far. I have been able to use ElementApi to output the forms into Json. Still no problem. My issue starts when I have to add validation to my form fields. I have read the "The Definitive Guide to Craft Validation for Plugin Developers (The Book)" and I am still very much confused as to how I actually implement validation on specific field in my form. In a nutshell, how can I add a email validator to an field that I named email. Also, how do I implement this to the fieldset if all I have to go with is:
{% set fields = tab.getFields() %}
<fieldset class="{{ tab.name |lower|replace(' ', '-') }}">
<legend>{{ tab.name }}</legend>
{% for field in fields %}
{% set input = craft.formBuilder2.getInputHtml(field) %}
{{ input | raw }}
{% endfor %}
</fieldset>
{% endfor %}
Not to sound silly but why, why, why why???? Please can someone help me....