Forums
This topic is locked
on blur change text box colour???
Posted 09 Jul 2002 18:06:56
1
has voted
09 Jul 2002 18:06:56 David Behan posted:
on blur change text box colour???Anyone know how to do it? That when a user selects clicks into a text box, the "class" changes to another value which has a different background colour set. I tried a view javascripts like change property in Dreamweaver MX but to no avail. Anyone know the actual script as I am not a javascript writer.
Thanks
Dave
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replies
Replied 09 Jul 2002 20:43:18
09 Jul 2002 20:43:18 Dave Thomas replied:
The search box on Macromedia uses this dave.
Have a look at the source and see if you can find it in there m8
"Get the kettle on, time for a brew"
Have a look at the source and see if you can find it in there m8
"Get the kettle on, time for a brew"
Replied 09 Jul 2002 22:38:37
09 Jul 2002 22:38:37 aegis kleais replied:
I'm not providing NN compat because I firmly belive that NN is garbage.
Try this:
<html>
<head>
<script language="javascript">
<!--
function changeColor(obj,color){
obj.style.backgroundColor = color;
}
//-->
</script>
</head>
<body>
<form>
<input type="text" style="background-color:red;" name="itembox" onFocus="changeColor(this, 'red')" onBlur="changeColor(this, 'blue')">
<br>
<input type="text">
</form>
</body>
</html>
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Try this:
<html>
<head>
<script language="javascript">
<!--
function changeColor(obj,color){
obj.style.backgroundColor = color;
}
//-->
</script>
</head>
<body>
<form>
<input type="text" style="background-color:red;" name="itembox" onFocus="changeColor(this, 'red')" onBlur="changeColor(this, 'blue')">
<br>
<input type="text">
</form>
</body>
</html>
Aegis Kleais
New Media Web Developer
(DWMX : IIS5.1 : SQL2K : WXP : ASP[VB/JS])
Replied 09 Jul 2002 23:52:10
09 Jul 2002 23:52:10 David Behan replied:
Thanks mate... that works brilliant. The macromedia example you gave is actually flash so thats how they did it.
Thanks again... it works perfectly.
Dave
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Thanks again... it works perfectly.
Dave
_________________________
David Behan - www.site-manager.com/af.asp?a=11&l=1tds9p6x2
Replied 10 Jul 2002 01:39:06
10 Jul 2002 01:39:06 Dave Thomas replied:
soz for the bum steer m8, it was just something i remembered seeing.
"Get the kettle on, time for a brew"
"Get the kettle on, time for a brew"