HTML forms
HTML forms
- Started
- Last post
- 5 Responses
- Atkinson
I have a mailing list form - name and email are the two input areas. Rather than having 'name' and 'email' outside of the form, I'd like these in the text field, so when someone clicks in the form they go. Know what I mean? Know how?
- zenmasterfoo0
javascript.
- BattleAxe0
just give field an initial value
value="name"
- dmay0
input type="text" value="Name" onfocus="if (this.value == 'Name'){ this.value = ''; }" onblur="if (this.value == ''){ this.value = 'Name'; }"
- Atkinson0
Good work, thanks v much
- fugged0
you might want to use javascript to clear the default value so when the user clicks in the field, the "name" or "email" text goes away. Likewise on blur, you could check to see if the value is blank, and if so put the default label text back in.