开发者

dynamic controls javascript

<input type='text' class='textbox numbers_开发者_StackOverflowonly deny_decimal pdt_qty' maxlength='6' style='float:left; width:70%' value='" + qty + "'>

I create the above control using javascript(if i press a button), but I can enter non-numeric value in the text box. ( I have written code to restrict user to enter non-numeric values). But it does not work only for the control i created dynamically? :(


You must add more details on how you create this control and how you attach the restrictions to the control.

It seems that you are doing a document.write, it's better create a DOM element as:

var control = document.createElement("input");
control.setAttribute(...);

and so on.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜