Limit the text field characters to 50 - cannot find function slice in Object 0
I am using this to limit the characters in the Text Field.
textField.value = textField.value.slice(0,50);
textField.value = textField.value.replace(/[^0-9]+/, "");
I am getti开发者_如何学运维ng an error, cannot find function slice in Object 0.
Use substr
textField.value = textField.value.substr(0,50);
精彩评论