Well I finally came up with some client side code to enable and disable my TextBoxes and by extension I figured out how to manipulate NumericTextboxes.
Only to find the following gotcha.
If I initially set the NumericTextBoxes to disabled in server side code I can never enable them.
If they are initially enabled in server side code I can disable and enable them to my hearts content.
Any ideas?
Here is the server side and client side code I'm using.
C#:
if (saParam[1] == 'Always')
{
AlwaysRadioButton.Checked =
true;
ConnectionNameTextBox.ReadOnly =
true;
InitiateConnectionCheckBox.Enabled =
false;
WaitRadNumericTextBox.Enabled =
false;
DelayRadNumericTextBox.Enabled =
false;
}
else if (saParam[1] == 'Any')
{
RunIfAnyRadioButton.Checked =
true;
ConnectionNameTextBox.ReadOnly =
true;
InitiateConnectionCheckBox.Enabled =
false;
WaitRadNumericTextBox.Enabled =
true;
DelayRadNumericTextBox.Enabled =
true;
}
else if (saParam[1] == 'Specific')
{
SpecificRadioButton.Checked =
true;
ConnectionNameTextBox.ReadOnly =
false;
InitiateConnectionCheckBox.Enabled =
true;
WaitRadNumericTextBox.Enabled =
true;
DelayRadNumericTextBox.Enabled =
true;
}
javascript:
function
DisableDelayWaitControls( bDisabled )
{
var ntbDelay = $find( "CriteriaDelayRadNumericTextBox" );
var ntbDelayUp = document.getElementById( "CriteriaDelayRadNumericTextBox" + "_SpinUpButton" );
var ntbDelayDown = document.getElementById( "CriteriaDelayRadNumericTextBox" + "_SpinDownButton" );
var ntbWait = $find( "CriteriaWaitRadNumericTextBox" );
var ntbWaitUp = document.getElementById( "CriteriaWaitRadNumericTextBox" + "_SpinUpButton");
var ntbWaitDown = document.getElementById( "CriteriaWaitRadNumericTextBox" + "_SpinDownButton" );
ntbDelay.disabled = bDisabled;
ntbWait.disabled = bDisabled;
ntbDelay._textBoxElement.disabled = bDisabled;
ntbDelayUp.disabled = bDisabled;
ntbDelayDown.disabled = bDisabled;
ntbWait._textBoxElement.disabled = bDisabled;
ntbWaitUp.disabled = bDisabled;
ntbWaitDown.disabled = bDisabled;
}
If the 'Always' code branch is executed I can never enable my controls in javascript.?????