CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignCSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old May 2nd, 2000, 04:43 AM
Chriss Chriss is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Location: Mainz, RP, Germany
Posts: 5 Chriss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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!

Reply With Quote
  #2  
Old May 3rd, 2000, 09:11 PM
jonherron jonherron is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2000
Posts: 24 jonherron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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!

Reply With Quote
  #3  
Old May 4th, 2000, 07:47 AM
Chriss Chriss is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 1999
Location: Mainz, RP, Germany
Posts: 5 Chriss User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation 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/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?


------------------

Reply With Quote
  #4  
Old May 4th, 2000, 11:39 AM
firepages's Avatar
firepages firepages is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: Perth West Australia
Posts: 757 firepages User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 h 18 m 32 sec
Reputation Power: 14
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignCSS Help > Change CSS class with Java

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap