开发者

Dojo NumberTextBox : defining max constraint

开发者 https://www.devze.com 2023-03-09 23:51 出处:网络
I\'m having troubles with the NumberTextBox max constraint. If I use standard markup declaration and create the numbertextbox with default setting, e.g.

I'm having troubles with the NumberTextBox max constraint. If I use standard markup declaration and create the numbertextbox with default setting, e.g.

dojo.require("dijit.form.NumberTextBox");
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/resources/dojo.css" rel="stylesheet" />
<link href="http://ajax.googleapis.com/ajax/libs/dojo/1.9.3/dijit/themes/claro/claro.css" rel="stylesheet" />
<script src="//ajax.googleapis.com/ajax/libs/dojo/1.9.3/dojo/dojo.js" djConfig="parseOnLoad:true"></script>

<body class="claro">
<input id="q05" type="text" dojoType="dijit.form.NumberTextBox" constraints="{places:0}" required="true" >

this control is constrained to be max of 16digits. And that's the issue. What if I need the user to be able to enter a 16+ digit number? I seem to be unable to overwrite this with the constraints:"{max:99999999999999999999}" (it's 20 of them) nor w开发者_开发问答ith the maxLength:"20" attributes.

Any ideas on how to properly set the control to be constrained let's say up to 20 digits, instead of 16 (which appears to be a limit now)?

Thank you


Use ValidationTextBox and use propert regExp to narrow possible input.

0

精彩评论

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

关注公众号