Search Tools Links Login

CSS/VBScript change background-color of txt-fields after type in


A real good way to show wich txtfields are required in a form!
If you type in some stuff in the txtfield, the color change.
In the example the color change from red to green.

Original Author: Mathias Stocker

Assumptions

Works only in IE but you dont get a Failure msg or something like that in NS
Create a Textfield like

Be sure that you've the name of the textfield in onchange="OC(T1)" (Here T1)
Put the following Script in the Body-Section of your Page
>>>>>>>>>>
PS: You can use every css attribute if you like to change not only the colors!
If you dont know the Scripting Version for the css attributes (for example html: style="BACKGROUND-COLOR:#FFFFFF" scripting: style.backgroundcolor="#FFFFFF") you will find it under http://msdn.microsoft.com/workshop/author/css/reference/attributes.asp
If you like this easy small script then please vote for me!

Code

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 296 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.