[thelist] JavaScript and Form Validation Trickery Not Working

ashok at magicalkenya.com ashok at magicalkenya.com
Sat Jun 8 13:00:01 CDT 2002


> document.forms[0].txtUsername.style.backgroundColor = .....

i dont think this method is supported in nn4 for <input> tags.  Cant you
just dump that browser ? though i know quite a few people still use
it....:)

What you could possibly do is use the layer writing abilites of nn4 to
apply a div with a  different background color around the empty input box.
(though this would mean your input box is not colored but the background of
your input box is coloured ! ). :

apply a <div> around to each <input> element.
in the example i have one called container1.
set a style in the stylesheet for this id and make it absolute with a white
background color:
something like :
#container1 {position:absolute;layer-background-color:white; }
you will also probably need to specify left, top , right etc. coordinates.

in the form :

<form >
<div id=container1>
<!--- change back ground color for this div using something like :
document.layer["container1"].document.bgColor = "red"
--->
<input  type=text/>
</div>
</form>

you will need to apply a different IDed <div> tag for each <input > field.
you can try this , though it seems a bit too much to do to just build in
support for nn4.

HTH
ashok



------
Ashok Hariharan
http://www.unganisha.org
Disclaimer : The contents of this mail should not be construed as  a "if
you attack me, I'll blast your arse" veiled threat
------







More information about the thelist mailing list