HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old February 18th, 2005, 02:33 PM
lezbfranz lezbfranz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 30 lezbfranz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 33 m 36 sec
Reputation Power: 0
Question clear textfield onclick

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!!

Reply With Quote
  #2  
Old February 18th, 2005, 02:43 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
You have to add the part in red.
Code:
<input type="text" value="Enter Keywords here..." name="textbox" onclick="cleartext()">

Reply With Quote
  #3  
Old February 18th, 2005, 02:52 PM
lezbfranz lezbfranz is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Feb 2005
Posts: 30 lezbfranz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 33 m 36 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old February 18th, 2005, 03:10 PM
Shadow Wizard's Avatar
Shadow Wizard Shadow Wizard is offline
Moderator From Beyond
ASP Free God 46th Plane (27500 - 27999 posts)
 
Join Date: Sep 2004
Location: Israel
Posts: 27,721 Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)Shadow Wizard User rank is General 14th Grade (Above 100000 Reputation Level)  Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1Folding Points: 377411 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 3 Months 2 Weeks 5 h 20 m 20 sec
Reputation Power: 1914
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 = '';" />

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > clear textfield onclick


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT