1

I'm building a wordpress plugin that includes serveral menus in the wordpress backend (admin). I'd like to use as many existing parts as possible and make my menus look like the standard wordpress ones.

Wordpress already does quite nice form validation on its admin forms and I already reuse the form-required class to enforce required form fields. However, I also need some validations that require an error message. I found a very nice tooltip-style version when you try to enter letters for media size: tooltip-style form validation error message in wordpress admin (media settings)

Can somebody provide a hint on how to reuse this from a custom jquery form validation script?

My form validation script does an ajax-request to find out if an email address is already taken. So using the number validation won't be enough, I need to put a custom error message inside the tooltip.

0

That's the standard html5 input validation pop up for chrome, you will have to create the pop up from scratch unless your inputs can make use of html5 form validation such as type=email or required

  • That's why it wasn't anywhere in the source code! Thanks a lot. Do you know any built in method to display form validation error messages? – Dave Mar 2 '15 at 9:20
  • Not off the top of my head, no. I imagine it can be manipulated, possibly with jQuery. I do remember reading a post about actually styling it differently. If you like it though I would build it from scratch as every browser displays that very differently iirc. – Jason Murray Mar 2 '15 at 9:23
  • @Dave of course I don't really mean build it from scratch, there will be some library out there to emulate it and give you more control over the content. – Jason Murray Mar 2 '15 at 9:26
  • Ok, thanks! I will try some jQuery tooltip plugin, tooltipster looks nice... – Dave Mar 2 '15 at 9:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.