|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I want to clear the textbox from the default entry I have --only for showing the user formatting needed! Anyway I saw on another forum this solution:
<html> <head> <script language="javascript"> function cleartext() { document.form1.textbox.value = "" } </script> </head> <body> <form name="form1"> <input type="text" value="Enter Keywords here..." onclick="cleartext()"> </form> </body> </html> I used it and the html runs with no hangups but when you goto the textbox and click on it to change it---instead of clearing nothing happens and I get a message at the bottom of the browser "error on page"! Any suggestions?? HELP!! SMILES! And thanks for ALL the help!! |
|
#2
|
||||
|
||||
|
You have to add the part in red.
Code:
<input type="text" value="Enter Keywords here..." name="textbox" onclick="cleartext()"> |
|
#3
|
|||
|
|||
|
OOPs yep---I left that out of the post but I do have a name for each of my textboxes---still same error!! Maybe it is some settings in iis----I have looked through EVERYTHING I can to try and find out whats up with this simple code. THANKs
|
|
#4
|
||||
|
||||
|
this has nothing to do with IIS or ASP, it's called "client side code", and using language called "javascript". as you can see, the thread is now in the HTML forum.
to have textbox cleared once focus being set on it have such code: Code:
<input type="text" value="Enter Keywords here..." onfocus="if (this.value == 'Enter Keywords here...') this.value = '';" /> |
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > clear textfield onclick |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|