我似乎无法使用onchange
事件。警报触发但我需要提交表单。
<script>
function validatelink3(returnpartid){
alert("test");
var theform = document.partsform;
theform.action="process_quickedited.asp?returnpartid="+returnpartid;
}
</script>
<form id="partsform" name="partsform" method="post" action="process_quickedited.asp?returnpartid=undefined">
<select name="STOCKACTION<%=objRst.fields("returnpartid")%>" id="STOCKACTION<%=objRst.fields ("returnpartid")%>" onchange="validatelink3(<%=objRst.fields("returnpartid")%>)">
<option value="<%response.write objRst.fields("stockaction")%>" selected="selected"><%response.write objRst.fields("stockaction")%></option>
<option value="Return To Supplier">Return To Supplier</option>
<option value="Stock">Stock</option>
<option value="Scrap">Scrap</option>
<option value="Quarantine">Quarantine</option>
<option value="Test">Test</option>
</select>
答案 0 :(得分:1)
如果您希望validatelink3()
提交表单,可以使用HTMLFormElement.submit
方法:
function validatelink3(returnpartid){
alert("test");
var theform = document.partsform;
theform.action="process_quickedited.asp?returnpartid="+returnpartid;
theform.submit();
}