0

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.

Sneha Dominic
  • 368
  • 2
  • 14

1 Answers1

0

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");
}
Rumen Jekov
  • 1,665
  • 2
  • 17
  • 19