|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
Okay, I have the follwoing in my html page: <td nowrap valign="top" width="500"><select name="color" onchange="change(1)"> <option selected value>Select New Color? <option value="#ffffff">White <option value="#ff0000">Red </option> </select> <input maxlength="7" name="decoy" size="7" value="#000000"></td> <td nowrap valign="top" width="50" class="1" id="test"> You see that when the option thing is changed it sends a command to a Java script. The script then writes the hex-code into the field right beside it and converts the hex-code into a css-class definition. Now I want the Class of the id-object "test" to be changed into the class definition. I want that so that I can let a user select a color and then see the actual color without having to submit the page to a perl script. uh... anybody understood what I meant? |
|
#2
|
|||
|
|||
|
in your function change(var), simply say:
test.className = var; that will place change the style class for the DOM object test to be what ever you pass into the function change. |
|
#3
|
|||
|
|||
|
First opf all, MANY thanks for the help! (Okay, it was easy, but still it helped me a LOT)
If you're interested in what I did with it go check it here: http://www.web-cm.de/cgi-bin/newgue...uest&pass=guest It doesn't work with NE, though. Anybody knows why? I use this: entry=window.document.colorset.bgcolor.value; window.document.colorset.bgcolorview.value=entry; to pass the entry back to the field. Is that the Layer difference from NE? What would be the approbriate call in NE? ------------------ |
|
#4
|
||||
|
||||
|
For NS.
Give your <div a name ie <div id="john" then : document.john.document.colorset.bgcolor.value; window.document.colorset.bgcolorview.value=entry; should work ?? ------------------ Simon Wheeler FirePages -DHTML/PHP/MySQL |
![]() |
| Viewing: Dev Shed Forums > Web Design > CSS Help > Change CSS class with Java |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|