我有一个单页网站,最初我有一个联系表格,
然后我复制了该联系表单并稍微更改了一下,当我点击页面中间的三个单独按钮时,我将表单添加到弹出窗口中。
出于某种原因,当我在弹出窗口中填写表格并按下发送时,它会向下滚动页面到底部的联系表格,并显示"字段要求"在底部联系表格中的一个字段中
以下是弹出窗体的代码:
<footer class="panel-footer">
<div class="myBtn btn btn-block btn-lg btn-default">Sign up now</div>
<div class="modal">
<div class="modal-content">
<div class="modal-header">
<span class="close" style="font-size:30px; color:#4A8EC8">×</span>
<h2><img src="img/style="width:200px"></h2>
</div>
<div class="modal-body">
<h4 style="color:white"><b><u>Sign up for a standard subscription</u></b></h4><br>
<form method="post" action="contact_standard.php" name="contactstandard" id="contactstandard">
<div class="results"></div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="sr-only">Name</label>
<input name="Full Name" type="text" class="form-control input-lg" placeholder="Name" required>
</div>
<div class="form-group">
<label class="sr-only">Email</label>
<input name="Email Address" type="email" class="form-control input-lg" placeholder="Email" required>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="sr-only">Phone Number</label>
<input name="Phone Number" type="number" class="form-control input-lg" placeholder="Phone Number">
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="sr-only">Organization Name</label>
<input name="Organization Name" type="text" class="form-control input-lg" placeholder="Organization Name">
</div>
</div>
<div align="center">
<button id="submit" type="submit" style="width:40%" class="btn btncenter btn-danger btn-lg btn-block">Send</button>
</div>
</div>
</div>
</div>
</footer>
</div>
</div>
这是页面底部表单的代码:
<section class="section section-contact" id="contact">
<div class="container">
<header class="section-header">
<h2 class="section-title">Contact Us</h2>
<div class="section-description">Contact us at any time - we love to talk.</div>
</header>
<div class="section-content">
<form method="post" action="contact.php" name="contactform" id="contactform">
<div class="results"></div>
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<label class="sr-only">Message</label>
<textarea name="message" class="form-control" placeholder="Message" style="height: 181px" rows="6" required></textarea>
</div>
</div>
<div class="col-sm-6">
<div class="form-group">
<label class="sr-only">Name</label>
<input name="name" type="text" class="form-control input-lg" placeholder="Name" required>
</div>
<div class="form-group">
<label class="sr-only">Email</label>
<input name="email" type="email" class="form-control input-lg" placeholder="Email" required>
</div><br>
</div><br>
<div class="col-sm-3 col-xs-12">
<button id="submit" type="submit" class="btn btn-danger btn-lg btn-block">Send</button>
</div>
</div>
</div>
</div>
</section>
答案 0 :(得分:1)
尝试在弹出窗口和底部联系人部分
上添加结束</form>
标记
<form method="post" action="contact.php" name="contactform" id="contactform">
...your form
</form>