javascript - How do I use the dojo constraints object to customize the text input field for an IP address in my dojo TextBox or NumberTextBox -
how use constraints object customize text input field ip address in dojo textbox or numbertextbox. or there object should using user has type ip address correctly.
i want create input field users input ip address requires this: pattern:'min:1,max255.min:0,max255.min:0,max255.min:0,max255'
i believe current problem i'm trying use numbertextbox , has constraints overriding constraints.
i know constraint options have available documentation on dojo constraints found deprecated , link replaced pointed datetimebox. :|
here snippet of code:
cellwidget.outproactfeedsdestaddr.set('constraints', {pattern:'min:1,max255.min:0,max255.min:0,max255.min:0,max255'});
while ip addresses numeric in sense, numbertextbox intended typical single numeric values, that's not option here. you've potentially got couple of choices:
- use validationtextbox , give appropriate
regexp
(note dijit expects string property, , applies^
,$
around itself), orvalidator
function (theredojox/validate/regexp.ipaddress
potentially play with) - write form widget combines 4
numbertextbox
instances 1value
(i'm not sure whether grid throw wrench works regard tab stops approach)
Comments
Post a Comment