Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to change the color of Radio by selecting the particular Radio button?.

Posted on 2001-08-08
8
Medium Priority
?
231 Views
Last Modified: 2010-04-09
Hi

How to change the color of Radio by selecting the particular button?. it is working in IE but not in Netscape. how to over come this.
1). the default color of Hello radio should be Green
2). and by selecting the Bye button the Hello button color shold be null and Bye       radio should
become Red color

<html><head>                                                                        
<script language="javascript">                                                
function fun()                                                                                                                                        
{

document.all.item("cell1").style.background="#FFFFFF";                                                                                                
document.all.item("cell2").style.background="red";  

}                                                                                                                                                    
function fun1()                                                                                                                                      
{                                                                                                                                                    
document.f1.all.item("cell2").style.background="#FFFFFF";                                                                                                
document.f1.all.item("cell1").style.background="green";                                                                                                  
}                                                                                                                                                    
</script>  
</head>                                                  
<body>                                                    
<form name=f1>                                                                                    
<table>                                                                                    
<tr><td id="cell1" bgcolor=Green>                                                          
<input type = radio name=m1 onclick="fun1()">hello</td>                                            
<td id="cell2" bgcolor="#FFFFFF">                                        
<input type = radio name=m1 onclick="fun()">Bye</td>                                              
</tr></table>
</form></body></html>
0
Comment
Question by:mmsreddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 3

Accepted Solution

by:
nzjonboy earned 200 total points
ID: 6366779
try this

<html><head>                                                                        
<script language="javascript">                                                
function fun()                                                                                      
                                                 
{
    if (document.layers) {
        window.document.layers['cell1'].bgColor = "#FFFFFF";
        window.document.layers['cell2'].bgColor = "red";
     }
    else if (document.all) {
        window.document.all['cell1'].style.background = "#FFFFFF";
          window.document.all['cell2'].style.background="red"
     }
}                                                                                                  
                                                 
function fun1()                                                                                    
                                                 
{                                                                                                  
    if (document.layers) {
        window.document.layers['cell2'].bgColor = "#FFFFFF";
        window.document.layers['cell1'].bgColor = "green";
     }
    else if (document.all) {
        window.document.all['cell2'].style.background = "#FFFFFF";
          window.document.all['cell1'].style.background="green"
     }
}    
                                               
</script>  
</head>                                                  
<body>                                                    
<form name=f1>                                                                                    
<table>
<tr><td id="cell1" bgcolor=Green><input type=radio name=m1 onclick="fun1()">hello</td>
<tr><td id="cell2" bgcolor="#FFFFFF"><input type=radio name=m1 onclick="fun()">Bye</td></tr>
</table>
</form></body></html>

nzjonboy
0
 

Author Comment

by:mmsreddy
ID: 6366879
Hi nzjonboy

Not working in Netscape4.7.
0
 

Author Comment

by:mmsreddy
ID: 6366884
Hi nzjonboy

Not working in Netscape4.7.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:mmsreddy
ID: 6366903
Hi nzjonboy

Not working in Netscape4.7.
0
 
LVL 3

Expert Comment

by:nzjonboy
ID: 6367083
have a look at this http://developer.irt.org/script/1441.htm

may help

nzjonboy
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6367730
All very nice but the background of a radio in Netscrap 4.x can only be changed by applying hte style inline you have to have it in a layer, and then re-write the layer.

Problem with that is that if you put the radio in a layer it will break the form in Netscrap and you cannot put it a cell because the layer must be absolutely positioned.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6629487
This question has been abandoned.  I will make a recommendation to the
moderators on its resolution in a week or two.  I appreciate any comments
that would help me to make a recommendation.

Cd&
 
0
 

Expert Comment

by:ComTech
ID: 6687001
I split the question points here, and accepted one on this page.  COBOLdinosaur I will leave you points in a new question in this TA.

Best regards and Happy Holidays,
ComTech
Community Support
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question