focusMagic jQuery Plugin

This plugin is meant to expedite the basic process of making form fields empty or clear on focus and refill on blur, depending on a few specs… a watermark. The three different scenarios that I have built for are represented.

  1. A normal form field watermark that empties on focus and refills on blur.
  2. A value that is set by the server trumps anything that the plugin does. (Note: this way, if a user has to fill out the form again because one of the fields didn’t validate, the server can send values so that the user doesn’t have to refill the whole form)
  3. There may be a time when you want to ignore the plugin and keep your label visible. Just add a ‘ignore’ class to your label and the plugin doesn’t touch it.

This solution focuses on accessibility as it does not remove the label, just moves it off the viewport. This way, if a user does not have Javascript, CSS, or uses a screen reader, they will still get normal labels.

View a demo
Download plugin (link to jQuery plugins)

Please let me know what you think about it, or if there is anything I should do to improve.

2 Responses to “focusMagic jQuery Plugin”

  1. Luigi Maha Says:

    Simply want to say your article is astounding. The clearness in your post is simply impressive and i can take for granted you are an expert on this subject. Well with your permission allow me to grab your rss feed to keep up to date with future post. Thanks a million and please keep up the strong work.

  2. Clarence Cachu Says:

    I was searching for photography when I found your site. Great post. Thank You.

Leave a Reply

Note: Since I upgraded to Wordpress 2.7, I have been able to support adding code to comments. If anyone knows of a plugin (that has been tested in 2.7) that will do this, please let me know. Other basic HTML is allowed for styling.