<ul>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
8 个解决方案
#1
action随便指定一个页面?
#2
action 这个无所未,关键是现在form提交不了
#3
提交前指定个action
#4
楼上的 ,这个是没有用的,我改成下面的样子,也没有用
<ul>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="test.asp" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').action="test.asp";
document.getElementById('form1').submit();
}
</script>
<ul>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="test.asp" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').action="test.asp";
document.getElementById('form1').submit();
}
</script>
#5
<ul>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
#6
to chon81(当我遇上你…)
你的代码和我的没有本质上的区别啊
在IE6里面也不能提交
你的代码和我的没有本质上的区别啊
在IE6里面也不能提交
#7
不好意思,我当时以为只是因为你在onXXXXX的属性值中用了javascript:XXXXX.
在onXXXXX的属性值中不需要用javascript,javascript:XXXXX是指在地址栏中运行脚本.
所以就去掉了,然贴上去,也没有试.
现在我已经改好了.
这个原因是因为IE6处理超接的方式不一样.
但是我下面的代码是不会运行javascript:Happy();的,如果你想运行Happy()的话,就把它放在ChangeSelectType(n);前面吧.
<ul>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(1);return false;">Click1</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(2);return false;">Click2</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(4);return false;">Click4</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(8);return false;">Click8</a></li>
</ul>
<form method="post" action="../phpinfo.php" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
在onXXXXX的属性值中不需要用javascript,javascript:XXXXX是指在地址栏中运行脚本.
所以就去掉了,然贴上去,也没有试.
现在我已经改好了.
这个原因是因为IE6处理超接的方式不一样.
但是我下面的代码是不会运行javascript:Happy();的,如果你想运行Happy()的话,就把它放在ChangeSelectType(n);前面吧.
<ul>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(1);return false;">Click1</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(2);return false;">Click2</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(4);return false;">Click4</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(8);return false;">Click8</a></li>
</ul>
<form method="post" action="../phpinfo.php" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
#8
应该是这里的问题;void(0)后面不能够加";"分号
<ul>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
<ul>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
#1
action随便指定一个页面?
#2
action 这个无所未,关键是现在form提交不了
#3
提交前指定个action
#4
楼上的 ,这个是没有用的,我改成下面的样子,也没有用
<ul>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="test.asp" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').action="test.asp";
document.getElementById('form1').submit();
}
</script>
<ul>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:Happy();" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="test.asp" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').action="test.asp";
document.getElementById('form1').submit();
}
</script>
#5
<ul>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0);" onclick="ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
#6
to chon81(当我遇上你…)
你的代码和我的没有本质上的区别啊
在IE6里面也不能提交
你的代码和我的没有本质上的区别啊
在IE6里面也不能提交
#7
不好意思,我当时以为只是因为你在onXXXXX的属性值中用了javascript:XXXXX.
在onXXXXX的属性值中不需要用javascript,javascript:XXXXX是指在地址栏中运行脚本.
所以就去掉了,然贴上去,也没有试.
现在我已经改好了.
这个原因是因为IE6处理超接的方式不一样.
但是我下面的代码是不会运行javascript:Happy();的,如果你想运行Happy()的话,就把它放在ChangeSelectType(n);前面吧.
<ul>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(1);return false;">Click1</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(2);return false;">Click2</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(4);return false;">Click4</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(8);return false;">Click8</a></li>
</ul>
<form method="post" action="../phpinfo.php" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
在onXXXXX的属性值中不需要用javascript,javascript:XXXXX是指在地址栏中运行脚本.
所以就去掉了,然贴上去,也没有试.
现在我已经改好了.
这个原因是因为IE6处理超接的方式不一样.
但是我下面的代码是不会运行javascript:Happy();的,如果你想运行Happy()的话,就把它放在ChangeSelectType(n);前面吧.
<ul>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(1);return false;">Click1</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(2);return false;">Click2</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(4);return false;">Click4</a></li>
<li><a href="javascript:Happy();" onclick="ChangeSelectType(8);return false;">Click8</a></li>
</ul>
<form method="post" action="../phpinfo.php" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function Happy(){return void(0);}
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
#8
应该是这里的问题;void(0)后面不能够加";"分号
<ul>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>
<ul>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(1);">Click1</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(2);">Click2</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(4);">Click4</a></li>
<li><a href="javascript:void(0)" onclick="javascript:ChangeSelectType(8);">Click8</a></li>
</ul>
<form method=post action="" id="form1" name="form1">
<input type="text" name="sSign" id="sSign" />
<input type="submit" />
</form>
<script language="javascript">
function ChangeSelectType(sign){
document.getElementById('sSign').value=sign;
document.getElementById('form1').submit();
}
</script>