87,989
社区成员
发帖
与我相关
我的任务
分享<input type="submit" onclick="return display()" value="确认" />
display()即为判定返回值的函数,return的值为true,则跳转;否则滞留当前页面。
$("a:contains('Apply')").bind("click",sales_budget_Validation);
$("a:contains('Apply')").bind("click",function(){return sales_budget_Validation}); <html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("input:submit").click(function() {
alert('1');
return false;
});
$("a").bind('click',clk);
});
function clk(){
alert(2);
return false;
}
</script>
</head>
<body>
<form method="post" action='b.html'>
<input type="submit" value='submit' style="height: 26px"/>
<a href='b.html' >2</a>
</form>
</body>
</html> <script type="text/javascript">
$(function() {
initForm();
});
</script><html>
<head>
<script type="text/javascript" src="jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
$("input:submit").click(function() {
alert('1');
return false;
});
});
</script>
</head>
<body>
<form method="post" action='b.html'>
<input type="submit" value='submit' style="height: 26px"/>
</form>
</body>
</html>
function initForm() {
sales_Validation();
}
function sales_Validation(){
$("a:contains('Apply')").bind("click",sales_budget_Validation);
};
function sales_budget_Validation(){
if ($("#P66_IS_SALES").val() == 'Y' && $("#P66_FORM_ID").val() != '' && $("#P66_TOTAL_BASE_AMT").val() != 0 ){
alert("已经超过总额");
return false;
}
}
};