Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExtJs NumberField

I am using ExtJs NumberField. The good thing is it validates that only numbers are entered. But I want a hyphen as well. How could I go about editing the javascript

  var <portlet:namespace/>issueNoField = new Ext.form.NumberField({  //This takes only numbers
             fieldLabel: 'Issue No',
             width: 120,
             displayField: 'Enter no',  
             valueField:'IssNo'
         });
like image 541
Some Java Guy Avatar asked Feb 10 '11 12:02

Some Java Guy


1 Answers

var <portlet:namespace/>issueNoField = new Ext.form.TextField({  //This takes only numbers
  fieldLabel: 'Issue No',
  width: 120,
  regex: /[1-9-]*/
});
like image 119
Mchl Avatar answered Oct 02 '22 01:10

Mchl