Highlighting form input fields

J

Joshua Beall

Hi All,

I've seen on various sites how you can adjust the coloring of form input
fields (particularly, text inputs and textareas). Here's an example:

http://tinyurl.com/4o8bw

http://www.macromedia.com/cfusion/m.../cfusion/webforums/forum/index.cfm?forumid=15

Move the focus to one of the fields and you will see that the background
color changes.

How do I do this? Is it possible to do without JS? I've been picking
through the source and can't seem to isolate it, JS or otherwise. Any tips?

-Josh
 
P

Phil Thompson

Joshua Beall said:
Hi All,

I've seen on various sites how you can adjust the coloring of form input
fields (particularly, text inputs and textareas). Here's an example:

http://tinyurl.com/4o8bw

http://www.macromedia.com/cfusion/m.../cfusion/webforums/forum/index.cfm?forumid=15

Move the focus to one of the fields and you will see that the background
color changes.

How do I do this? Is it possible to do without JS? I've been picking
through the source and can't seem to isolate it, JS or otherwise. Any
tips?


you can use CSS to do this alas, it only works in better browsers such as
Firefox, Opera et al.

input[type="text"]:focus, textarea:focus{
background: #FFF;
border-color: #0F0;
}

By using input[type="text"]:focus as opposed to just input:focus it stops
the submit button's appearance from changing, which can look pretty crap.

You can probably use JS for this as well or Dean Edward's IE7
http://dean.edwards.name/IE7/

Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top