我如何才能显示一个成功的消息后,人按提交了一个表单在引导模式
How can I display a sucess message after person pressed submitted a form in bootstrap modal?
我正在制作一个网站的原型,我正试图使它看起来像一个人提交一个表单接收他们的信息在一个引导模态的东西。
我在我的页面顶部有这个登录:
<div class="center-top-div">
<form class="well inline-form" action="sidor/my_page.html" method="">
<input type="text" class="span2" placeholder="Username">
<input type="password" class="span2" placeholder="Password">
<a href="sidor/index_inloggad.html" class="btn btn-small btn-primary pull-right" id="logga-in-btn">Log in</a><br>
<a class="pull-right" id="amnesi" href="#myModal" data-toggle="modal">Forgotten?</a>
</form>
</div>
当点击链接"Forgotten?"时,会显示一个模式:
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 id="myModalLabel">Vi behöver din E-postadress!</h4>
</div>
<div class="modal-body">
<form class="well inline-form larger-input">
<input class="input-large" type="text" class="span2" placeholder="Din E-postadress...">
<a href="//I WANT THIS TO LINK TO ANOTHER MODAL/GREETING MESSAGE" class="btn btn-small btn-primary pull-right"
id="logga-in-btn">Get my details!</a><br>
</form>
</div>
<div class="modal-footer">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
我想要的是,当一个人点击"获取我的详细信息!"我想在情态或其他情态中显示问候信息或其他东西。
任何想法都将受到赞赏!:)
比尔您需要为任何点击事件的发生使用事件委托。看看这是否满足你的需要。这将在模态本身中显示消息。
http://jsfiddle.net/spaXZ/
$('body').on('click','#logga-in-btn' ,function(){
$(this).closest('.modal-body').find('#grtmessage').remove().end().append($('<span id="grtmessage">Thank you, we have now email you your details</span>'));
});
如果你想显示为模态,你可以这样做:- http://jsfiddle.net/HxrHd/
相关文章:
- 保存两个模型(属于第三个模型)和一个提交
- 使用一个提交按钮验证两个字段
- 在迭代中仅启用一个提交按钮
- 只能通过一个提交按钮发布值
- 如何使用一个提交按钮提交三个表单
- 两个表单 - 一个提交按钮
- 你能用一个提交按钮执行两个javascript函数吗?
- 一个提交按钮打开两个页面 - 一个新窗口中
- 如何创建一个只有一个提交按钮的具有三个文本输入字段的表单
- 如何在一个提交按钮上有两个操作
- 获取一个提交绑定为KnockoutJs的对象
- 如何制作一个提交自己的表格
- 我怎么能有一个提交按钮的多个形式
- 只允许三个按钮中的一个提交web表单
- Html -防止其他提交事件,而一个提交正在进行中
- Onclick中有一个提交按钮
- 用一个提交按钮提交两个表单
- JavaScript表单提交在表单中包含一个提交按钮
- 两个下拉框和一个提交按钮
- 我在AngularJS中有一个复选框列表和一个提交按钮