Hi Lajos,
Thanks for your interest in Essential JS 2 and sorry for the delay.
No, it is not possible to add the validation rules to corresponding input element based on class. The form validation method is name attribute based.
We have created a simple sample and validated an element based on name attribute and check the class name in the custom function. Please find the below link for further details.
Please let us know if you require any further assistance on this.
Regards,
Sridurgha U