Address: http://ht19820316.blog.163.com/blog/static/3395523320113222421670/
/* <Br/> * logon page with verification code <br/> * sheak <br/> * code. PHP verification code generation <br/> * 1202 added the keyboard press ENTER submission function (in bold) <br/> */<br/>/* <br/> * User Logon page with verification code <br/> * sheak 081115 <br/> * code. PHP code generation <br/> */<br/> Ext. quicktips. init (); <br/> loginwindow = ext. extend (<br/> Ext. window, <br/> {<br/> title: 'login system', <br/> width: 275, <br/> Height: 155, <br/> collapsible: true, <br/> defaults: {<br/> border: false <br/>}, <br/> buttonalign: 'center', <br/> createformpanel: function () {<br/> // form reset function <br/> function reset () {<br/> myform. form. reset (); <br/>}< br/>; </P> <p> // form submission function, which is extracted separately, A level with myform <br/> function subjectform () {<br/> If (myform. getform (). isvalid () {<br/> myform. form. submit ({<br/> waitmsg: 'logging on ...... ', <br/> URL :'.. /.. /.. /index/login ', <br/> Timeout: 3000, <br/> success: function (Form, Action) {<br/> If (action. result. type = 0) // op <br/> window. location. href = '.. /OP/index.html '; <br/> else <br/> window. location. href = 'index.html '; <br/>}, <br/> failure: function (Form, Action) {<br/> form. reset (); <br/> If (action. failuretype = ext. form. action. server_invalid) <br/> Ext. messageBox <br/>. alert (<br/> 'Warning ', <br/> action. result. errors. MSG); <br/>}< br/>}); <br/>}< br/> <br/>; </P> <p> var myform = new Ext. form. formpanel ({<br/> bodystyle: 'padding-top: 6px ', <br/> defaulttype: 'textfield', <br/> labelalign: 'right ', <br/> labelwidth: 55, <br/> labelpad: 2, <br/> // frame: True, <br/> method: 'post ', <br/> // Add a form keyboard event. If the keyboard is set to 10 or 13, the subjectform method is triggered. <br/> keys: [{<br/> key: [10, 13], <br/> FN: subjectform <br/>}], <br/> defaults: {<br/> allowblank: false, <br/> width: 158 <br/>}, <br/> items: [{<br/> CLS: 'user', <br/> name: 'username ', <br/> fieldlabel: 'account No. ', <br/> blanktext: 'account cannot be blank' <br/>},{ <br/> CLS: 'key ', <br/> name: 'Password', <br/> fieldlabel: 'password ', <br/> blanktext: 'password cannot be blank', <br/> inputtype: 'Password' <br/>},{ <br/> CLS: 'key', <br/> name: 'randcode', <br/> ID: 'randcode ', <br/> fieldlabel: 'verification code ', <br/> width: 70, <br/> blanktext: 'verification Code cannot be blank' <br/>}], <br/> buttons: [{<br/> text: 'true', <br/> ID: 'Sure ', <br/> handler: subjectform // click the mouse button to submit the form <br/>},{ <br/> text: 'reset ', <br/> ID: 'clear', <br/> handler: reset <br/>}] <br/>}); <br/> return myform; <br/>}, </P> <p> initcomponent: function () {</P> <p> loginwindow. superclass. initcomponent. call (this); <br/> This. fp = This. createformpanel (); <br/> This. add (this. FP); </P> <p >}< br/>}); </P> <p> Ext. onready (function () {<br/> var win = new loginwindow (); </P> <p> win. show (); <br/> var BD = ext. getdom ('randcode'); <br/> var bd2 = ext. get (BD. parentnode); <br/> bd2.createchild ({<br/> tag: 'img ', <br/> SRC: 'Code. PHP ', <br/> align: 'absbottom' <br/>}); </P> <p> });