如何使用输入提交表单重置密码后创建弹出窗口?

时间:2015-09-08 23:55:30

标签: html

我试图在没有太多JS的情况下实现这一点,但不确定我是否可以做到这一点。     我有一个密码重置页面,当用户点击"完成",然后我希望该对话框消失,并替换为一个替换另一个的弹出/对话框,并说"我们已向您发送了一封电子邮件,说明如何重置密码....请检查您的电子邮件等。"  *它需要在提交数据后出现。如你所见,我似乎无法做到这一点。任何想法/方向将不胜感激:

<form method="post">
<a href="#openModal"><input type="submit" name="email" value="Continue"></a>
<div id="openModal" class="modalDialog">
 <div><a href="#close" title="Close" class="close"></a>
 <p>We have sent you an email with instructions on how to reset your password.</p>
 </div>
</form>

1 个答案:

答案 0 :(得分:1)

像这样:

<!doctype html>
<html>
<head>
<script>
function sent() {
alert("We have sent you an email with instructions on how to reset your   password.");
}
</script>
</head>
<body>
<form method="post">
<a href="#openModal">
<input type="submit" name="email" value="Continue" onclick="sent()">
</a>
<div id="openModal" class="modalDialog">
<div><a href="#close" title="Close" class="close"></a>

</form> 
</body>
</html>