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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disabling a radiobuttonlist

Status
Not open for further replies.

iaswnidou

Programmer
Joined
Apr 19, 2005
Messages
140
Location
GR
Hello

I have a few radiobuttonlists on a form and on load i am checking if the selected item has a specified value, then disable the radiobuttonlist.

Code:
function IterateListControl(ListControl,value)
{
	for (i=0; i<ListControl.length;i++)
	{
		if (ListControl[i].checked==false)
		{
			ListControl.disabled = true;
		}
		else if (ListControl[i].checked==true)
		{
			if (ListControl[i].value == value)
			{
				ListControl.disabled = true;
			}
			else {ListControl.disabled = false;}
		}
	}
}

function OnLoad(textbox,radio)
{
	var storeylist = document.PropertyDetails.rdbStoreyList;
	IterateListControl(storeylist,8);
	
.
.
.

I step through the code line by line and the last one executed is "ListControl.disabled = true;", but the control is not disabled. Could you help?

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top