
Autopopulating Text Input Fields with JavaScript
http://www.456bereastreet.com/archive/200710/autopopulating_text_input_fields_with_javascript/
Johansson, Roger
456 Berea Street
2007
Abstract:
Few people will argue against the need to explain to users what they are supposed to enter into text input fields. One common workaround when no label can be displayed is to put some placeholder text in the text field and let that act as the label.This approach works reasonably well, but it burdens the user with having to clear the input before entering their own text, which can lead to frustration and mistakes. An approach that avoids that is using JavaScript to clear the input when it receives focus. Since that won’t work when JavaScript support is missing, JavaScript should be used to insert the placeholder text as well.