HelpNearMe
asked on
HTML input text box onchange event
Hi Experts,
I'm no javascript expert so I need a hand with this. See attached screenshot.
Currently the input field that has the text 'Full Name' is just a standard input text element with the value set to 'Full Name'. This sucks because the user needs to delete the text in order to update the contents.
How can I use javascript to clear the value when the user clicks inside the input box?
Thanks,
HNM
sample2.jpg
I'm no javascript expert so I need a hand with this. See attached screenshot.
Currently the input field that has the text 'Full Name' is just a standard input text element with the value set to 'Full Name'. This sucks because the user needs to delete the text in order to update the contents.
How can I use javascript to clear the value when the user clicks inside the input box?
Thanks,
HNM
sample2.jpg
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I think you just need to add this code to your textbox html
With this code, when user clicks on the text box, default text 'Full Name' will be cleared.
You append to your html code like this
<input type="text" name="fname" value="Full Name" onclick="if(this.value=='F ull Name') this.value=''">
onclick="if(this.value=='Full Name') this.value=''"
With this code, when user clicks on the text box, default text 'Full Name' will be cleared.
You append to your html code like this
<input type="text" name="fname" value="Full Name" onclick="if(this.value=='F
ASKER
I try some of the ideas tonight
thanks,
HNM
thanks,
HNM
ASKER
the external js file worked with the addition of $.noConflict
Thanks!
HNM
Thanks!
HNM
ASKER
I should have mentioned the joomla thing first, but do you have any ideas how to do this given the new constraints?
HNM