twitter-bootstrap关闭警报不工作 [英] twitter-bootstrap closing alert does not work
本文介绍了twitter-bootstrap关闭警报不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我无法让它工作。当我点击关闭按钮时,没有任何反应。
I can't get it to work. When I click the close button, nothing happens.
这里是代码:
<div class=" alert alert-error alert-block" style="width:200px" >
<button class="close" data-dismiss="alert">×</button>
<span>errors</span>
</div>
我在jsfiddler上复制了这个问题:http://jsfiddle.net/graphicsxp/7L7Nd/
I've reproduced the issue on jsfiddler: http://jsfiddle.net/graphicsxp/7L7Nd/
EDIT
@using (Html.BeginForm(null, null, FormMethod.Post, new { id = "quoteWizard" }))
{
<input type="hidden" id="ModelType" value="CarQuoteRequestViewModel" />
ViewBag.ValidationSummaryClass = ViewData.ModelState.IsValid ? "validation-summary-valid" : "validation-summary-errors";
<div class="@ViewBag.ValidationSummaryClass alert alert-error in fade" data-valmsg-summary="true">
<button class="close" data-dismiss="alert">×</button>
<span>Before you can continue, please make sure you have completed the mandatory fields
highlighted below.</span>
<ul style="display: none" />
</div>
@RenderSection("QuoteSection")
<div class="ui-formwizard-nav">
<input id="back" value="@Resource.Global.Previous" type="reset" class="btn btn-primary" />
<input id="next" value="@Resource.Global.Next" class="btn btn-primary" type="submit" />
</div>
}
推荐答案
。
我现在使用的是span,而不是使用按钮,因此表单不会提交:
Instead of using a button, I'm now using a span, so the form doesn't get submitted:
<span class="close" data-dismiss="alert">×</span>
感谢您的帮助
这篇关于twitter-bootstrap关闭警报不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文