Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Dec 26, 2007 11:52 AM by NC01
Dec 26, 2007 01:28 AM|LINK
I try to disable checkboxlist using vbscript :
document.all.checkboxlist.Enabled = true
but i got error saying : Object doesn't support this property or method "Enabled"
Can anyone help me?
Thanks in advanced
Dec 26, 2007 01:52 AM|LINK
Assuming checboxlist is the id of the control, try this code
Dec 26, 2007 01:58 AM|LINK
Please understand that i want to do it client side using vbscript.
And i want to set the enable property of checkboxlist to true or false
Not setting the visibility to be hidden or not
Dec 26, 2007 02:00 AM|LINK
Dec 26, 2007 02:10 AM|LINK
there is no way to set the enable property from VBScript????
Dec 26, 2007 10:04 AM|LINK
Well Setting the display to none is a popular way of hiding it. Other wise some controls like text box have a property called disabled where setting it to true leaves it on the screen but grays it out
assuming textbox is the client id of a text box
See an example here http://www.quirksmode.org/js/disabled.html
Dec 26, 2007 11:52 AM|LINK
Try this as a CheckBoxList renders as a <table> tag:
var tableRef = document.getElementById('<%= CheckBoxList1.ClientID %>');
for (var i=0; i<tableRef.rows.length; i++)
for (var j=0; j<tableRef.rows[i].cells.length; j++)
var listControl = tableRef.rows[i].cells[j].childNodes;
listControl.disabled = enableOrDisable;