您的位置:首页 > Web前端 > JavaScript

html(jsp)如何实现对form提交前进行确认

2014-12-09 17:42 323 查看
<html>
<head>
<title>Validator</title>
<script type="text/javascript">
function checkForm() {
if (window.confirm("Are you sure you want to sumbit this form?")) {
return true;
}
return false;
}
</script>
</head>
<body>
<form action="2.html" onsubmit="return checkForm()">
Please click the submit button:<br>
<input type="text" name="text" value="text"><br>
<input type="submit">
</form>
</body>
</html>



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐