Ext2.0中,需要加什么判断方法,能保证email的格式正确?(问题已解决,4楼正解)

Ext.onReady(function(){
    Ext.QuickTips.init();
    Ext.form.Field.prototype.msgTarget = 'side';
   
   var emailfield = new Ext.FormPanel({
        labelWidth: 100,
        frame:true,
        title: 'Email Field',
        bodyStyle:'padding:5px 5px 0',
        width: 360,
        defaults: {width: 220},
        defaultType: 'textfield',
        items: [{
                fieldLabel: 'Email',
                name: 'email',
                vtype:'email',
                id:'email'
            }
        ],
        buttons:[{
             text:'确定',
             handler:function(){

             if( 需要加什么方法? ){

                  alert("你输入的邮箱地址不正确!");

             }

            else

                   alert("保存成功");
             }
        },{
             text:'取消'
            
        }]
    });
    emailfield.render('emailfield');
});


        我这是做一个例子,不用与后台交互,上面的括号里需要加什么判断方法,才能使当email 为空或者格式不正确的时候,弹出错误信息?
请指教!

你可能感兴趣的:(prototype,ext,360)