在线急等一个提交问题
请问大虾:为什么下面代码中的隐藏表单域的value不能在脚本代码中设置?
function forgetpass()
{
document.fm_log.bt_log.value= "forgetPassword ";
document.fm_log.action= "Log ";
document.fm_log.submit();
}
function regist()
{
document.fm_log.bt_log.value= "regist ";
document.fm_log.action= "Log ";
document.fm_log.submit();
}
...
<form name= "fm_log " action= " " method= "post ">
...
<input type= "button " name= "bt_log " value= "登陆 " onClick= "load(); ">
<input type= "button " value= "忘记密码 " onClick= "forgetpass(); ">
<input type= "button " value= "注册 " onClick= "regist(); ">
<input type= "hidden " name= "bt_log " value= " ">
现在我想让这两个button提交到一个Servlet,通过这个隐藏表单域来区分是哪个button,可是老是不能设置成功这个bt_log的value,请问怎样才能成功设置呢?
------解决方案-------------------- <input type= "hidden " name= "bt_log " value= " ">
改个名字看看
你上面有个button 也叫这个名字