用一个变量保存,提交之前赋予hidden即可。<form onsubmit="return preSubmit(this)"> <input type=hidden name=xhid> ... </form> <script> var xx="123"; // use this variable to hold information // dosomething else; function preSubmit(frm){ frm.xhid.value=xx; return true; } </script>
<input type=hidden name=xhid>
...
</form>
<script>
var xx="123"; // use this variable to hold information
// dosomething else;
function preSubmit(frm){
frm.xhid.value=xx;
return true;
}
</script>
document.form1.reset
document.form1.hiddenitem.value=dd