Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Havig Problems Referencing Controls on Page

Status
Not open for further replies.

SDyke

MIS
Oct 13, 2005
55
US
Why does the following syntax generate an error that control is null or not an object?

document.form1.text3.value = "Steve";
 
Thanks! This works for my radio buttons except for those that are located within tabbedPanels. Is there some other qualifier I need to add to the code string to compensate for the tabbedPanel?
 
It is sure strange that the first two lines of this code work but the third one doesn't. Note the radio1 button group is located in a tabbedPanel.

Code:
<SCRIPT type="text/javascript">
	
function myControlValues(){
		
document.getElementById('form1').elements['form1:radio2'][1].checked=true;
document.getElementById('form1').elements['form1:radio1'][1].disabled=true;
document.getElementById('form1').elements['form1:radio1'][1].checked=true;
		
		
	}
</SCRIPT>
 
After doing some more checking and testing this is what I found out. If I put an alert() after the set checked on this is what happens.

I run the page. The radio button is not checked. I refresh the page. The radio button is checked and the alert appears. I click the ok on the alert and the radio button becomes unchecked. Note: This is only for the radio button located in the tabbedPannel.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top