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'}); 

enter image description here

while ip addresses numeric in sense, numbertextbox intended typical single numeric values, that's not option here. you've potentially got couple of choices:

  1. use validationtextbox , give appropriate regexp (note dijit expects string property, , applies ^ , $ around itself), or validator function (there dojox/validate/regexp.ipaddress potentially play with)
  2. write form widget combines 4 numbertextbox instances 1 value (i'm not sure whether grid throw wrench works regard tab stops approach)

Comments

Popular posts from this blog

java - Could not locate OpenAL library -

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

sorting - opencl Bitonic sort with 64 bits keys -