public
Description: jQuery plugin to populate form inputs with example text that disappears on focus. See also http://github.com/mudge/jquery_placeholder
Home | Edit | New

Home

Potentially Useful Links

How Can I Use This Plugin With Password Fields?

The standard plugin itself doesn’t support this functionality but code has been contributed in the past that allows this kind of usage (the second solution is likely to be the better one as the first relies on changing the type attribute of a password field which is forbidden in a lot of browsers).

Can you give a more complete example of how to use the plugin?

If you’re unfamiliar with jQuery then the basic usage is as follows:

<form action="/user">
  <p><input id="name" name="name" /></p>
  <p><input type="submit" value="Save" /></p>
</form>

<script type="text/javascript" src="/javascripts/jquery.js"></script>
<script type="text/javascript" src="/javascripts/jquery.example.min.js"></script>
<script type="text/javascript">
  $(function() {
    $('#name').example("Joe Bloggs");
  });
</script>
Last edited by mudge, Wed May 13 14:06:40 -0700 2009
Home | Edit | New
Versions: