在选择时,我使用struts1.2调用javascript来进行服务器调用,但它没有生成call.Please,让我知道哪里出错了,下面是代码
<html:form action="/populate">
<html:select property="tName" onchange="test()">">
<html:option value="">SELECT</html:option>
<html:options name="tList" />
</html:select>
</html:form>和stuts-config有
<action path="/populate" name="tForm" type="com.testAction" validate="false" parameter="method" scope="request" >
<forward name="success" path="/failure.jsp" />
</action>而javascript是
function test(){
var selObj = document.getElementById("tName");
var selIndex = selObj.selectedIndex;
if (selIndex != 0) {
document.form[0].selIndex.action="/populate.do?method=execute&testing="+selIndex;
document.form[0].submit();
}
}发布于 2010-04-01 13:30:46
document.forms -复数。
发布于 2010-04-01 13:39:06
document.forms[0].action="..."; // (don't need "selIndex" in there)https://stackoverflow.com/questions/2558310
复制相似问题