使用ext提交表单出错,求大神帮忙

jsp页面代码如下:
<%@ page language="java" contentType="text/html; charset=utf-8"
pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%String msg=(String)(request.getAttribute("error_msg")==null?"":request.getAttribute("error_msg")); %>



用户登录



<br> Ext.onReady(function(){<br> var myForm=new Ext.FormPanel({<br> defaultType: &#39;textfield&#39;,<br><br> labelAlign: &#39;center&#39;,<br><br> labelWidth: 70,<br><br> renderTo:document.body,<br> frame:true,<br> title:&quot;用户登录&quot;,<br> width:300,<br> items:[{<br> xtype:&quot;textfield&quot;,<br> fieldLabel:&quot;用户名&quot;,<br> name:&quot;username&quot;<br> },<br> {<br> xtype:&quot;textfield&quot;,<br> fieldLabel:&quot;密 码&quot;,<br> name:&quot;password&quot;<br> }],<br> buttons:[{<br> text:&quot;登录&quot;,<br> handler:function(){<br> if(myForm.form.isValid()){<br> var btn=this;<br> btn.setDisabled(true);<br> this.setText(&quot;正在登录&quot;);<br> myForm.form.action(&quot;submit&quot;,{<br> url:&quot;http://localhost:8080/ssi-login/login.action&quot;,<br> method:&quot;post&quot;<br> })<br> }<br> }<br> }]<br> })<br> var msg=&#39;&lt;%=msg%&gt;&#39;;<br> if(msg!=&quot;&quot;){<br> Ext.Msg.alert(msg);<br> }<br> })<br>




报错如下:
Uncaught TypeError: undefined is not a functionlogin.jsp:38 Ext.FormPanel.buttons.handlerext-all.js:22040 Ext.Button.Ext.extend.onClickext-all.js:1622 C

1个回答

if (myForm.form.isValid()) {

=====>

if (myForm.getForm().isValid()) {

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问