Suppose you have two input fields with instance names tf_input1 and tf_input2, you could use the following code:
code:
INPUTNOTSETMESSAGE = "<CLICK HERE TO ENTER TEXT>";
tf_input1.onSetFocus = formSetFocus;
function formSetFocus(oldFocus) {
if (this.text == INPUTNOTSETMESSAGE) {
this.text = "";
}
}
function formKillFocus(newFocus) {
if (this.text == "") {
this.text = INPUTNOTSETMESSAGE;
}
}
tf_input1.onSetFocus = formSetFocus;
tf_input1.onKillFocus = formKillFocus;
tf_input1.onKillFocus();
tf_input2.onSetFocus = formSetFocus;
tf_input2.onKillFocus = formKillFocus;
tf_input2.onKillFocus();
(Two fields only necessary to show it working properly!)