用javascript动态设置action和encoding
[ 2011-09-07 14:03:09 | 作者: admin ]
<SCRIPT LANGUAGE= "JavaScript ">
function aaa(theform)
{
if(theform.isup.checked==true){
document.forms[0].encoding= "multipart/form-data ";
document.forms[0].action= "1.asp?isup=1 ";
}else{
document.forms[0].encoding= "application/x-www-form-urlencoded ";
document.forms[0].action= "1.asp?isup=0 ";
}
alert(theform.action);
}
</SCRIPT>
function aaa(theform)
{
if(theform.isup.checked==true){
document.forms[0].encoding= "multipart/form-data ";
document.forms[0].action= "1.asp?isup=1 ";
}else{
document.forms[0].encoding= "application/x-www-form-urlencoded ";
document.forms[0].action= "1.asp?isup=0 ";
}
alert(theform.action);
}
</SCRIPT>
<FORM METHOD=POST action="" onsubmit= "aaa(this); ">
<INPUT TYPE= "checkbox " NAME= "isup "> <INPUT TYPE= "submit ">
</FORM>
[最后修改由 admin, 于 2011-09-07 14:04:22]

这篇日志没有评论。
此日志不可发表评论。