extjs form

Ext.onReady(function() {
	// Ext.MessageBox.alert("title","msg");
	Ext.QuickTips.init();
	var form = new Ext.FormPanel({
		frame : true,
		width : 300,
		// monitorValid:true,//绑定验证
		layout : "form",
		labelWidth : 70,
		title : "添加个人信息",
		labelAlign : "left",
		renderTo : Ext.getBody(),
		submit : function() {
			this.getEl().dom.action = 'ext.jsp', this.getEl().dom.method = 'POST', this.getEl().dom.submit();
		},
		items : [{
					xtype : "textfield",
					fieldLabel : "用户名",
					// id:"UserName",
					allowBlank : false,
					blankText : "不能为空,请正确填写",
					name : "UserName",
					anchor : "90%"
				}, {
					xtype : "textfield",
					fieldLabel : "昵称",
					// id:"SmallName",
					name : "SmallName",
					anchor : "90%"
				}, {
					xtype : "datefield",
					fieldLabel : "注册日期",
					// id:"RegDate",
					name : "RegDate",
					anchor : "90%"
				}],

		buttons : [{
					text :"确认",
					handler : login,
					formBind : true
				}, {
					text :"取消",
					handler : reset
				}]
	});
	function login() {
		form.form.submit();//
	}
	function reset() {
		form.form.reset();//
	}

});

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