How to enable JavaScript validation for custom plugin
-
Hello…
I created a new plugin that shows some forms that I need to validate. I have realized about the existing forms, for example, to create new users or pages. If I click submit on those forms, without filling required fields, the fields are highlighted in red, showing that I need to fill them.
I need to achieve the same for my custom plugin. Of course I can download and install a jquery validation plugin, but if WordPress already comes with this functionality, why not to use that instead?
I have added class=”validate” to my form, form-required class to each tr tag and aria-required=”true” to required fields, as user-new.php file does, but without success.
Thanks in advance,
Jaime
The topic ‘How to enable JavaScript validation for custom plugin’ is closed to new replies.