Ext提交验证提示

来源:互联网 发布:数据库系统是以为中心 编辑:程序博客网 时间:2024/05/05 07:22

 

Ext.onReady(function() {

    var reg = new Ext.Window({

        applyTo: 'content',

        width: 500,

        height: 300,

        modal: true,

        closable: false,

        resizable: false,

        title: '注册',

        layout: 'border',

        items: [{

            region: 'center',

            xtype: 'form',

            id: 'reg_form',

            labelAlign: 'top',

            bodyStyle: 'padding:10px',

            buttons: [{

                xtype: 'button',

                id: 'register_button',

                text: '注册',

                handler: function() {

                    if (Ext.getCmp('user_name').getValue() == "") {

                        Ext.getCmp('user_name').el.frame("ff0000", 2, { duration: 0.5 });

                    }

                }

                }],

                items: [{

                    xtype: 'textfield',

                    fieldLabel: '用户名',

                    name: 'user_name',

                    id: 'user_name',

                    anchor: '99%'

                }, {

                    xtype: 'textfield',

                    fieldLabel: '密码',

                    inputType: 'password',

                    id: 'password1',

                    name: 'password1',

                    anchor: '99%'

                }, {

                    xtype: 'textfield',

                    fieldLabel: '重复密码',

                    inputType: 'password',

                    id: 'password2',

                    name: 'password2',

                    anchor: '99%'

                }

, {

   xtype: 'textfield',

   fieldLabel: 'Email',

   name: 'user_email',

   anchor: '99%'

}

]

            }, {

                region: 'west',

                width: 200,

                xtype: 'form',

                bodyStyle: 'padding:10px',

                buttons: [{

                    xtype: 'button',

                    text: '登录',

                    handler: function() {

 

                    }

                    }],

                    items: [{

                        border: false,

                        id: 'register_message',

                        html: '注册说明'

                    }]

                    }]

                    });

 

                    reg.show();

                });