'************************************** ' Name: CSS/VBScript change background-c ' olor of txt-fields after type in ' Description:A real good way to show wi ' ch 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. ' By: Mathias Stocker (from psc cd) ' ' ' Inputs:None ' ' Returns:None ' 'Assumes:Works only in IE but you dont g ' et a Failure msg or something like that ' in NS Create a Textfield like <input type="text" style="background-color:#FF0000;color:#FFFFFF" onchange="OC(T1)" name="T1" size="20"> Be sure that you've the name of the textfield inonchange="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! ' 'Side Effects:None '************************************** <SCRIPT Language = "vbscript"> Function OC(object) if len(object.value)>0 then object.style.backgroundcolor="#00FF00" object.style.color="#000000" else object.style.backgroundcolor="#FF0000" object.style.color="#FFFFFF" end if End Function </SCRIPT>