开发者

Limit the text field characters to 50 - cannot find function slice in Object 0

开发者 https://www.devze.com 2023-03-29 04:00 出处:网络
I am using this to limit the characters in the Text Field. textField.value = textField.value.slice(0,50);

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消