Solved

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

Posted on 2001-08-08
8
226 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Outlook opens HTML email as text 4 29
jQuery Sticky Menu 24 34
Need HTML output in powershell line by line 3 25
send email part1 9 22
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
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 …
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

789 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