我的模态中有一个简单的表单,每当我点击提交按钮时它都无效。没有任何事情发生。
<div class="modal fade" id="subModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel">Enter your email for updates!</h4>
</div>
<div class="modal-body">
<form action="subscribe.php" method="POST" role="form">
<div class="form-group">
<input type="text" id="email" class="form-control" placeholder="mail@mail.com" required name="email">
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<input type="submit" class="btn btn-primary" id="submit" value="Subscribe!">
</form>
</div>
</div>
</div>
</div>
我还在表单周围包裹了提交按钮。有什么不对吗?
答案 0 :(得分:-1)
你错过了你的表格方法吗?
@using (Html.BeginForm("ActionName", "ControllerName", null, FormMethod.Post, new { id = "justid" }))
{
//your code
}