try something like<form method="post" name="form1" action="some.jsp">
<input type="hidden" name="ret">
<input type="button" value="test" onclick="testClick()">
</form><script language="javascript">
function testClick()
{
var bRet = confirm("确定或取消?");
if (bRet)
{
 alert("you clicked 确定");}
else
{
 alert("you clicked 取消");
}document.form1.ret.value = bRet;
document.form1.submit();
}
</script>

解决方案 »

  1.   

    to saucer(思归, MS .NET MVP)
    你是用onclick事件来触发javascript函数的,能否在判断某条件成立时自动confirm,然后根据用户的选择来决定页面下面的转向?
      

  2.   

    >>>判断某条件成立?
    what kind of condition? if it is related to the change of a textbox's value, you could something like<input type="text" onchange="testClick()">or<input type="text" onpropertychange="testClick()">for some other conditions, you could use setExpression method for a specific object
      

  3.   

    我明白怎么做了,谢谢saucer(思归, MS .NET MVP)