Closed Bug 315991 Opened 19 years ago Closed 19 years ago

checking checkboxes dynamically does not work with Firefox1.0.7

Categories

(Firefox :: General, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dkommineni, Unassigned)

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7

I have two check boxes, on checking of first check box, I need to check another check box. Same way if i uncheck one checkl box i need to uncheck other check box too. 
 
This is my code in JSP: where i am calling onclick event function
<TR>
<TD>Maintenance (unscheduled):</TD>
<TD><html:checkbox property="maintenance" onclick = "changeMaintenance('maintenance','onRoadFail');"/>
</TD>
<TD colspan="2">On road failure shutdown:
<html:checkbox property="onRoadFail" onclick = "changeOnRoadFail('onRoadFail','maintenance'); "/>
</TD>
</TR>
.
 and the javascript for this function is below:

function changeMaintenance(maintenance, onRoadFail){
	if( document.forms[0].maintenance.checked == false){
		document.forms[0].onRoadFail.checked = false;	
	}

}

function changeOnRoadFail(onRoadFail, maintenance){
	if( document.forms[0].onRoadFail.checked){
		document.forms[0].maintenance.checked = true;	
	}

}

The above code is working both in IE and Netscape but not in Firefox.


Reproducible: Always

Steps to Reproduce:
I have two check boxes, on checking of first check box, I need to check another check box. Same way if i uncheck one checkl box i need to uncheck other check box too. 
 
This is my code in JSP: where i am calling onclick event function
<TR>
<TD>Maintenance (unscheduled):</TD>
<TD><html:checkbox property="maintenance" onclick = "changeMaintenance('maintenance','onRoadFail');"/>
</TD>
<TD colspan="2">On road failure shutdown:
<html:checkbox property="onRoadFail" onclick = "changeOnRoadFail('onRoadFail','maintenance'); "/>
</TD>
</TR>
.
 and the javascript for this function is below:

function changeMaintenance(maintenance, onRoadFail){
	if( document.forms[0].maintenance.checked == false){
		document.forms[0].onRoadFail.checked = false;	
	}

}

function changeOnRoadFail(onRoadFail, maintenance){
	if( document.forms[0].onRoadFail.checked){
		document.forms[0].maintenance.checked = true;	
	}

}

The above code is working both in IE and Netscape but not in Firefox.

Actual Results:  
checkboxes are not checked or unchecked dynamically

Expected Results:  
the other check box should be checked or unchecked dynamically
Does it work in 1.5?
(In reply to comment #1)
> Does it work in 1.5?
> 

I downloaded 1.5 version and it is working now.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.