|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Can this be done with plain ole' form syntax (such as DESELECT greying out a text box), or must I use some javascript?
TIA, ------------------ - Mike Stembridge http://www.georgiaoffroad.com |
|
#2
|
|||
|
|||
|
Sorry, I don't quite get what you'd like to do... can you please reformulate for us foreigners?
![]() |
|
#3
|
|||
|
|||
|
I will already have a default value in a <INPUT type=TEXT> tag. What I would like is for the default value to appear highlighted, so that as soon as the user presses a key the highlighting is gone and the selected key appears in it's place.
Sorry if this doesn't make it any clearer... It's a pretty simple concept but sometimes simple concepts are not easy to explain for whatever reason. |
|
#4
|
|||
|
|||
|
You could probably do something like:
document.form.fieldname.focus() document.form.fieldname.select() That would highlight the text that's currently in there, and being selected, it would clear the text once the user started typing.. |
|
#5
|
|||
|
|||
|
You could also have the text in the field, and the clear the text when the user clicks in the field..
<form> <input type="text" size=10 value="Enter your name" onfocus="clearField(this)"> </form> and there'd be a javascript function like: function clearField(someText) { if (someText.value == someText.defaultValue) { someText.value="" } } |
![]() |
| Viewing: Dev Shed Forums > Web Design > HTML Programming > Forms - automatically highlighting VALUEs |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|