Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize HTML5 Alert Messages #351

Closed
mathetos opened this issue Oct 19, 2015 · 2 comments
Closed

Customize HTML5 Alert Messages #351

mathetos opened this issue Oct 19, 2015 · 2 comments
Assignees
Milestone

Comments

@mathetos
Copy link
Member

The HTML5 alerts are not specific to the field that is missing at all. They can be customized per field. I tested this code and it works great:
http://blog.thomaslebrun.net/2011/11/html-5-how-to-customize-the-error-message-for-a-required-field/#.ViVY_tKrSUl

Considerations

  • The JS would have to be localized (meaning wp_localize_script() -- not internationalization) in order to pass the string dynamically
  • Not sure there's a reliable way to get_text JS reliably so that local translations can be provided via the local .po file
@DevinWalker DevinWalker added this to the 1.6 milestone Jul 6, 2016
@ramiy
Copy link
Contributor

ramiy commented Jul 19, 2016

I agree, wp_localize_script() is the common way to pass translation strings to JS.

@DevinWalker
Copy link
Member

I'm bumping this to 1.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants