Solved

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

Posted on 2001-08-08
8
223 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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 3

Accepted Solution

by:
nzjonboy earned 50 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
 

Author Comment

by:mmsreddy
ID: 6366903
Hi nzjonboy

Not working in Netscape4.7.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now