I’m building a plugin to manage course information and am struggling to put form validation on the new meta boxes I’ve added.
Has anyone a good way of putting JS / JQuery validation on the admin menus?
Thanks
I’m building a plugin to manage course information and am struggling to put form validation on the new meta boxes I’ve added.
Has anyone a good way of putting JS / JQuery validation on the admin menus?
Thanks
You must be logged in to post a comment.
Ok got it to work. I couldn’t find anything on the web about this, bar one guy’s page, which did actually work but wasn’t quite as good a solution as I’d wanted. I did some research how the main plugins are doing it, and only found some unintuitive custom JS ways.
Anyway success I got it to work using a JQuery library in the end. I put the scripts in the footer because I needed to target a specific page:
The jquery.validate.min.js is here. The calibrate script looks something like:
And then I added the classes I’d defined to the actual form elements in the meta-boxes:
And that worked 🙂