我有这样的功能:
function checksub7 (){
var NetBusiness = $("#ConfigForm\\:NetBusiness").attr("value");
var isShowRgHall = $("#ConfigForm\\:isShowRgHall")[0].checked;
if(!NetBusiness == 'false' && isShowRgHall){
var errorMsg = $("#errorMsg").attr("value");
self.parent.$("#subframe").attr("src","../../webcontent/web/nocomponent.jsf?netbusinessmsg="+errorMsg+"&messagetype="+1);
return false;
}
return true;
}
这样的jsp文件:
<h:form id="ConfigForm" onsubmit="waitForSubmit();">
<table class="configtable" cellpadding="0" cellspacing="0" >
<tr>
<td class="configtd" style="padding-left:15px;;">
<h:inputHidden id="NetBusiness" value="#{ConfigBean.hasNetBusiness}" />
<div id="otherconfigdiv" class="configdiv">
<table id="otherconfigtable" class="configtable" cellpadding="0" cellspacing="0">
...
<tr>
<td class="configlefttd "> </td>
<td class="configrighttd ">
<h:commandButton value="#{text['global.action.save']}" action="#{ConfigBean.update7}" styleClass="btn" onclick="return checksub7();"/>
<span class="cmbtnspn10"></span>
<input type="button" value="${text['global.action.reset']}" class="btn" onclick="reset7();" />
</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</h:form>
我在onclick="return checksub7();"
说Cannot return from outside a function or method.
时收到错误
我不知道这个以及为什么会这样。
任何人都可以帮我解决这个问题吗?
谢谢。