I have this JavaScript method (setExpansionControls) which is called from window.onload(). The call works just fine. The variable txtBox refers to a RadNumercInput control.
function setExpansionControls(enable) {
var txtBox = $find('ctl00_ContentPlaceHolder1_RMExpandableInSqFt');
if (txtBox != null) {
if (enable) {
txtBox.enable();
}
else {
txtBox.disable();
}
}
}
The problem: txtBox is ALWAYS null when called from onload, but it is not when called from elsewhere. I can disable/enable the input control just fine if I click a button on a loaded page.
So my question: How do we know when we can safely call methods on an initialized input control? If window.onload isn't able to get a reference to the control, what can?
TIA,
Ian
function setExpansionControls(enable) {
var txtBox = $find('ctl00_ContentPlaceHolder1_RMExpandableInSqFt');
if (txtBox != null) {
if (enable) {
txtBox.enable();
}
else {
txtBox.disable();
}
}
}
The problem: txtBox is ALWAYS null when called from onload, but it is not when called from elsewhere. I can disable/enable the input control just fine if I click a button on a loaded page.
So my question: How do we know when we can safely call methods on an initialized input control? If window.onload isn't able to get a reference to the control, what can?
TIA,
Ian