同样挂接这三个按钮的onclick事件,结果为什么不一样?!!A:
<input type=button value="确 定" class=button onclick="return submitForm(1)" name="submitbutton">
B:
<input type=button value="上一步" class=button onclick="backForm('S')" name="BackButton">
C:
<td width="19%"><input type="image" name="image" src="templates/login/ccic-net/images/login.png" value="登 陆" alt="单击此处登录"/></td><td width="52%"><a href="#" onClick="javascript:findPassword();" 都一样的代码:点击A或C后,继续执行了"return submitForm(1)"和"backForm('S')"点击C按钮后,却没执行"javascript:findPassword();" 源码如下:
((HTMLButtonElementEvents_Event)users2).onclick += new HTMLButtonElementEvents_onclickEventHandler(this.OnButtonClick); public bool OnButtonClick()
{
if (System.Windows.Forms.MessageBox.Show("您确定要保存吗?", "询问", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.OK)
{
System.Windows.Forms.MessageBox.Show("选择了确定");
return true;
}
else
{
System.Windows.Forms.MessageBox.Show("选择了取消");
return false;
}
}
难道挂接BHO后onclick事件返回的false仅对js有效?
<input type=button value="确 定" class=button onclick="return submitForm(1)" name="submitbutton">
B:
<input type=button value="上一步" class=button onclick="backForm('S')" name="BackButton">
C:
<td width="19%"><input type="image" name="image" src="templates/login/ccic-net/images/login.png" value="登 陆" alt="单击此处登录"/></td><td width="52%"><a href="#" onClick="javascript:findPassword();" 都一样的代码:点击A或C后,继续执行了"return submitForm(1)"和"backForm('S')"点击C按钮后,却没执行"javascript:findPassword();" 源码如下:
((HTMLButtonElementEvents_Event)users2).onclick += new HTMLButtonElementEvents_onclickEventHandler(this.OnButtonClick); public bool OnButtonClick()
{
if (System.Windows.Forms.MessageBox.Show("您确定要保存吗?", "询问", System.Windows.Forms.MessageBoxButtons.OKCancel, System.Windows.Forms.MessageBoxIcon.Question, System.Windows.Forms.MessageBoxDefaultButton.Button2) == System.Windows.Forms.DialogResult.OK)
{
System.Windows.Forms.MessageBox.Show("选择了确定");
return true;
}
else
{
System.Windows.Forms.MessageBox.Show("选择了取消");
return false;
}
}
难道挂接BHO后onclick事件返回的false仅对js有效?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货