Reputation: 468
I am using a RadTextBox control and I need to set an reset MaxLength property based on some conditions, in client side.
if(maxLengthToSet == 4){
txtBox.set_maxLength(4);
}
else{
// reset maxlength so that it can accept up-to limits of a RadTextBox
}
How can we reset the maxLength property or remove this property from the textBox.
Upvotes: 0
Views: 162
Reputation: 1675
We have already solved this at the Telerik ticketing system.
I am sharing the solution here for your fellow developers:
if (maxLengthToBeSet == 4) {
textBox.get_element().setAttribute('maxLength', 4)
}
else {
textBox.get_element().removeAttribute("maxLength");
}
Upvotes: 0