3

I wish to have an input field with the prompt inside the field to save presentation space.

Is it possible to have a cross browser password input field on a form that has a text prompt such as Password: * as you start typing it either masks the password or is a true password field.

If you post the form, capture the response which is immediately stored as a password, therefore not text and as a value is submitted no prompt, but should you clear the box, the prompt Password: * re appears.

iggyweb
  • 2,373
  • 12
  • 47
  • 77
  • possible duplicate of [Showing Placeholder text for password field in IE](http://stackoverflow.com/questions/6052544/showing-placeholder-text-for-password-field-in-ie) – winner_joiner Jul 09 '13 at 10:42
  • In this [SO-Post](http://stackoverflow.com/questions/6052544/showing-placeholder-text-for-password-field-in-ie) there are many answers and one jsfiddle example that might help [here](http://jsfiddle.net/mNchn/) from the Answer of Kei. – winner_joiner Jul 09 '13 at 10:45
  • Just use `` (together with a polyfill for IE if you need it) – Bergi Jul 09 '13 at 13:19
  • Problem Solved :You can do the trick follow this URL http://stackoverflow.com/questions/30028615/browser-rember-me-password-prompt-disable/34615586#34615586 – Mukesh Jan 05 '16 at 15:58

3 Answers3

3

HTML5 has the placeholder attribute, which you can apply to an input element, like this:

<input type="password" placeholder="Enter your password here..." />

If you need to support placeholder-like capability in pre-HTML5 browsers, then check out Cross-Browser Support For HTML5 Placeholder Text In Forms

Karl Anderson
  • 34,606
  • 12
  • 65
  • 80
1

<input type="password" placeholder="password goes here" />

http://jsfiddle.net/qwGd6/

http://www.w3schools.com/tags/att_input_placeholder.asp

Note that this is not supported in IE9 and below. Go figure.

Samuel Reid
  • 1,756
  • 12
  • 22
1

It sounds like you are looking to watermark the input field. If you are using jQuery, you can use the watermark plugin. This particular plugin works for password marked inputs.

Or you can also use HTML 5's Placeholder as seen here on stackoverflow.

Community
  • 1
  • 1
  • Thank you, that led me to http://mathiasbynens.be/demo/placeholder which seems to work across all browser I have tried :-) – iggyweb Jul 09 '13 at 10:44