EXTJS 양식 검증 방법

1581 단어 EXTJS
EXTJS 
Ext.onReady(function(){
    var form = new Ext.form.FormPanel({
    labelAlign: 'right',
    labelWidth: 250
});
form.add(new Ext.form.TextField({
    fieldLabel: ' ',
    allowBlank: false
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' 5, 10',
    name: 'text',
    maxLength: 10,
    minLength: 5
}));
form.add(new Ext.form.TextField({
    fieldLabel: 'E-mail',
    name: 'text',
    vtype: 'email'
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' ',
    name: 'text',
    vtype: 'alpha'
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' ',
    name: 'text',
    vtype: 'alphanum'
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' ',
    name: 'text',
    vtype: 'url'
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' ',
    name: 'text',
    regex: /^[\u4E00-\u9FA5]+$/,
    regexText: ' '
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' 13 , 9 !',
    name: 'text',
    regex: /^13[\d]{9}$/,
    regexText: ' 13 , 9 !'
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' :0xx-1234344',
    name: 'text',
    regex: /^0(\d{2}|\d{3})\-(\d{7}|\d{8})$/,
    regexText: ' :0xx-1234344'
}));
form.add(new Ext.form.TextField({
    fieldLabel: ' IP ',
    name: 'text',
    regex: /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,
    regexText: ' IP '
}));
form.render("form");

좋은 웹페이지 즐겨찾기