日期:2014-05-16 浏览次数:20734 次
var formPanel = new Ext.form.FormPanel({ title: '以下资料为必填', defaultType: 'textfield', margins:'3 0 3 3', cmargins:'3 3 3 3', labelAlign:"right", bodyStyle:'padding:5px 5px 0', url: 'studentServlet?cmd=add', frame:true, items:[ { fieldLabel:'学号', allowBlank:false, name:'sno' }, { fieldLabel:'姓名', allowBlank:false, name:'name' }, new Ext.form.ComboBox({ fieldLabel: '性别', name: 'sex', store: new Ext.data.SimpleStore({ fields: ['sex'], data: [['男'], ['女']] }), displayField:'sex', emptyText:'选择你的性别……', mode: 'local', allowBlank:false, selectOnFocus:true, width: 150 }), { fieldLabel:"专业方向", allowBlank:false, name:'subject' }, new Ext.form.DateField({ fieldLabel: '出生年月', name: 'birthday', allowBlank:false, width: 150 }), { fieldLabel:"联系电话", allowBlank:false, name:'phone' }, { fieldLabel:"电子邮件", name:'email', allowBlank:false, vtype:'email' All States in Document",allStates); } function outputList(title,states) { var out=title; var currentState=""; alert(states.length) for(var i=0;i<states.length;i++) { currentState=states[i]; out=out+"\n-"+currentState.childNodes[0].nodeValue; } //alert(out); } </script> </head> <body> <h1>process xml document of u.s. states</h1> <form action="#"> <br /><br /> <input type="button" value="view all listed states" onclick="startRequest('all');" /> <br /><br /> <input type="button" value="view all listed north northern states" onclick="startRequest('north');" /> </form> </body> </html>