I'm working a directive to autotab between elements whenever the element's maxLength is hit. But first, I'm trying to figure out how to make sure that an element can't have a value whose length is greater than the element's maxlength.
Here's what I've tried so far:
if (el.value.length >= el.maxLength) {
el.value = el.value.substr(0, el.maxLength);
}
If I set a breakpoint and step through it, right after executing this, el.value
is being set correctly, but in the view it's still allowing the user to type.