HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

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 Dev Shed Forums Sponsor:
  #1  
Old December 11th, 2000, 09:00 PM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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

Reply With Quote
  #2  
Old December 12th, 2000, 08:21 AM
RedFox RedFox is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 45 RedFox User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Sorry, I don't quite get what you'd like to do... can you please reformulate for us foreigners?

Reply With Quote
  #3  
Old December 12th, 2000, 12:39 PM
mstembri mstembri is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: Norcross, GA
Posts: 458 mstembri User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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.


Reply With Quote
  #4  
Old December 12th, 2000, 06:03 PM
cokeman cokeman is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 3 cokeman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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..

Reply With Quote
  #5  
Old December 12th, 2000, 06:06 PM
cokeman cokeman is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2000
Posts: 3 cokeman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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=""
}
}

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Forms - automatically highlighting VALUEs


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



 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





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