#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Mainz, RP, Germany
    Posts
    5
    Rep Power
    0
    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>&nbsp;&nbsp; <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?

    Comments on this post

    • JimmyGosling agrees
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    24
    Rep Power
    0
    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.

    Comments on this post

    • JimmyGosling agrees
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Location
    Mainz, RP, Germany
    Posts
    5
    Rep Power
    0
    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/newgues...est&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?


    ------------------
  6. #4
  7. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2000
    Location
    Perth West Australia
    Posts
    757
    Rep Power
    15
    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

Similar Threads

  1. dynamically change css
    By awelch in forum CSS Help
    Replies: 1
    Last Post: January 11th, 2004, 10:25 AM
  2. dropdown menu to change css
    By awelch in forum CSS Help
    Replies: 0
    Last Post: January 11th, 2004, 04:29 AM
  3. How can I change visibility of all class elements?
    By adamay in forum HTML Programming
    Replies: 6
    Last Post: December 31st, 2003, 06:07 PM
  4. how to change image size in java scripts.
    By reeni in forum HTML Programming
    Replies: 3
    Last Post: October 17th, 2003, 08:14 AM
  5. how to link java class file to a ppt slide
    By sravan in forum Java Help
    Replies: 0
    Last Post: October 7th, 2003, 08:05 AM

IMN logo majestic logo threadwatch logo seochat tools logo