Hi,
I'm using some custom code in a boonex page to display a form.
Just to give you a bit of context my code creates inputs like this:
$aInput = array(
'type' => $sInputType,
'caption' => $sFieldTranslation,
'name' => "field_$sFieldName",
'attrs' => array( 'id' => "Input_$sFieldName")
);
...
Then calls this method to generate the form:
$oForm = new BxTemplFormView($aForm);
If I want to make a field required I add "required" to the class:
'attrs' => array('class' => 'required', 'id' => 'ReviewTitle')
My question is what should I add to have a validation on the length? I would like one field to be exactly 10 characters long.
I see from jquery documentation that there is a https://jqueryvalidation.org/maxlength-method/
But where should I add this into my code?
Thanks,
Luca.