大佬教程收集整理的这篇文章主要介绍了jquery – Twitter Bootstrap模态表单提交,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
这种形式在模态本身是外在的,我根本无法弄明白这是怎么可能的
我已经尝试将模态本身添加到窗体中,尝试使用HTML5 form =“form_list”,甚至将窗体添加到模态体,并使用一些jquery强制提交,但没有任何显示工作
下面是一个示例模式,我试图增加我需要的,OK按钮以前编辑尝试调用jquery函数.
<div class='modal small hide fade' id='mymodal' 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> <h3 id='mymodalLabel'>delete Confirmation</h3> </div> <div class='modal-body'> <p class='error-text'>Are you sure you want to delete the user?</p> </div>"); <div class='modal-footer'> <button class='btn btn-danger' data-dismiss='modal' aria-hidden='true'>Cancel</button> <button class='btn btn-success' data-dismiss='modal'>Ok</button> </div> </div>
这里是一个模式中的形式的例子:
<a href="#mymodal" role="button" class="btn" data-toggle="modal">Launch demo modal</a> <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> <h3 id="mymodalLabel">Modal header</h3> </div> <div class="modal-body"> <form id="myForm" method="post"> <input type="hidden" value="Hello" id="myField"> <button id="myFormSubmit" type="submit">Submit</button> </form> </div> <div class="modal-footer"> <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button> <button class="btn btn-priMary">Save changes</button> </div> </div>
和jquery ajax获取表单域并提交..
$('#myFormSubmit').click(function(E){ e.preventDefault(); alert($('#myField').val()); /* $.post('http://path/to/post',$('#myForm').serialize(),function(data,status,xhr){ // do something here with response; }); */ });
工作在Bootply:http://bootply.com/59864
以上是大佬教程为你收集整理的jquery – Twitter Bootstrap模态表单提交全部内容,希望文章能够帮你解决jquery – Twitter Bootstrap模态表单提交所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。