這個(gè)表單也是我使用中的一個(gè)東西。感覺還不錯(cuò)。 先看運(yùn)行效果 看代碼 <!DOCTYPE?html?PUBLIC?"-//W3C//DTD?XHTML?1.0?Transitional//EN"?"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> < html ? xmlns = "http://www.w3.org/1999/xhtml" > < head > < link ? rel = "stylesheet" ? type = "text/css" ? href = "resources/css/ext-all.css" /> < script ? type = "text/javascript" ? src = "adapter/prototype/prototype.js" > </ script > < script ? type = "text/javascript" ? src = "adapter/prototype/scriptaculous.js?load=effects" > </ script > < script ? type = "text/javascript" ? src = "adapter/prototype/ext-prototype-adapter.js" > </ script > < script ? type = "text/javascript" ? src = "ext-all.js" > </ script > < style ? type = "text/css" > #LOGIN_FORM_LAYER?{ ??position:relative; ??top:150px; ??width:?965px; ??height:?551px; } #loginDIV?{ ??width:500px; ??position:relative; ??top:100px; } </ style > </ head > < body > < center > < script ? type = "text/javascript" > Ext.onReady(function(){ ????Ext.QuickTips.init(); ????//?turn?on?validation?errors?beside?the?field?globally ???? Ext.form.Field.prototype.msgTarget ?=? 'side' ; ????var? bd ?=? Ext .getBody(); ????/* ?????*?================??Simple? form ??======================= ?????*/ ????//bd.createChild({tag:?'h2',?html:?'Form?1?-?Very?Simple'}); ????var? simple ?=? new ?Ext.FormPanel({ ????????id:?'LOGIN_FORM', ????????labelWidth:?75,?//?label?settings?here?cascade?unless?overridden ????????url:'login.jsp', ????????frame:true, ????????title:?' < font ? size = 3 > 登錄系統(tǒng) </ font > ', ????????bodyStyle:'padding:5px?5px?0', ????????width:?350, ????????defaults:?{width:?230}, ????????defaultType:?'textfield', ????????ctCls:?'font-size:12px', ????????items:?[{ ????????????????fieldLabel:?'用戶名', ????????????????name:?'username', ????????????????allowBlank:false ????????????},{ ????????????????fieldLabel:?'密碼', ????????????????name:?'password', ????????????????inputType?:'password' ????????????},new?Ext.form.Hidden({ ??????????????name:'referer', ??????????????value:'/index' ????????????}) ????????], ????????buttons:?[{ ????????????id:?'submitButton', ????????????type:?'submit', ????????????text:?'登錄', ????????????tooltip:?'點(diǎn)擊這個(gè)按鈕登錄系統(tǒng)', ????????????handler:?login ????????}] ????}); ????simple.render("loginDIV"); }); function?login(){ ??Ext.Ajax.request({ ????url:?'/login', ????form:?'LOGIN_FORM', ????success:?function(t){ ??????alert(t.responseText); ????} ??}); } </ script > < div ? id = "LOGIN_FORM_LAYER" > < div ? id = "loginDIV" > </ div > </ div > </ center > </ body > </ html > 其中的/login處理登錄的代碼我就不寫了。大家自己做吧。 Ext2.2用戶名和密碼登錄表單的例子 更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主 微信掃碼或搜索:z360901061 微信掃一掃加我為好友 QQ號(hào)聯(lián)系: 360901061 您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。 【本文對(duì)您有幫助就好】元 2元 5元 10元 20元 自定義 喜歡作者