Hi all,
I was wondering how to require a text field on the condition that a checkbox is checked.
I have a text field that collects a completion date with a related checkbox that denotes isComplete. I want to set a requiredField validator on the text field.
I've added a required field validator to the text field and set it to enabled=false, and in the code behind when I confirm that the check box is checked, I set the requiredField validator to enabled=true, then call the validate function for the validator, like so:
if (checkbox.chacked)
{
this.reqValDateCompleted = true;
this.reqValDateCompleted.Validate();
}
but nothing happens, which makes me think I'm using the wrong methods for doing this.
Can someone point me in the right direction, please?
I was wondering how to require a text field on the condition that a checkbox is checked.
I have a text field that collects a completion date with a related checkbox that denotes isComplete. I want to set a requiredField validator on the text field.
I've added a required field validator to the text field and set it to enabled=false, and in the code behind when I confirm that the check box is checked, I set the requiredField validator to enabled=true, then call the validate function for the validator, like so:
if (checkbox.chacked)
{
this.reqValDateCompleted = true;
this.reqValDateCompleted.Validate();
}
but nothing happens, which makes me think I'm using the wrong methods for doing this.
Can someone point me in the right direction, please?