开发者

setting Maxmimu lenght for obout Edit control?

开发者 https://www.devze.com 2023-01-16 21:13 出处:网络
In my web application i am using obout Edit control. I want to restrict the user to type only 400 characters how can i restrict the user.i write javascript like this.

In my web application i am using obout Edit control. I want to restrict the user to type only 400 characters how can i restrict the user.i write javascript like this.

function textCounter(field,cntfield,maxlimit) { if (field.value.length > maxlimit) { alert("Cannot type more than 450 characters"); field.value = field.value.substring(0, maxlimit); } else { cntfield.value = maxlimit - field.value.length; } }

// this is text box

开发者_开发问答

but it is giving error like no onkeydown for editor.


on the textbox there is a maxlength attribute that you can see

and that will only allow 400 characters to be entered

0

精彩评论

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