我會盡量簡潔,我是bootstrap和高級javascript的新手,基本上我使用bootstrap模式在用戶面前加載表單以收集和保存數據在數據庫中。我的問題是你將如何使用Ajax,因爲我有其他模式也將有不同的形式,我不想一次又一次地處理整個頁面。 PS 我是笨進行申請如何通過Bootstrap Modal使用Ajax提交表單
這裏面模態形式
<section id="launch" class="modal hide fade" style="width: 800px; left: 500px;">
<header class="modal-header" style="height: 7px; background: none repeat scroll 0% 0% rgb(87, 164, 210);">
<h4 style="margin-bottom: 0px; margin-top: -5px; text-align: center; color: white;">Unit Details</h4>
<button type="button" class="close" data-dismiss="modal" style="margin-top: -20px;">×</button>
</header>
<?php echo form_open('setupnewblock/registerNewBlock'); ?>
<div class="modal-body" style="padding-top: 0px; padding-left: 0px; " >
<div style="position: relative; left: 43px; margin-top: 41px; margin-left: 0px;">
<span>Address 1</span>
<input type="text" placeHolder="" name="address1" style="width: 219px; height: 17px; margin-left: 20px; margin-top: 3px;" value="<?php echo set_value('address1'); ?>"/>
<br />
<span>Address 2</span>
<input type="text" placeHolder="" name="address2" style="width: 219px; height: 17px; margin-left:20px; margin-top: 3px;" value="<?php echo set_value('address2'); ?>"/>
<br />
<span>Address 3</span>
<input type="text" placeHolder="" name="address3" style="width: 219px; height: 17px; margin-left:20px; margin-top: 3px;" value="<?php echo set_value('address3'); ?>"/>
<br />
<br />
</div>
<footer class="modal-footer" style="margin-top: 475px;">
<input type="submit" value="Save" name="save" class="btn btn-primary" style="margin-top: 2px; height: 27px; width: 89px;" data-dismiss="modal"></input>
<?php echo form_close(); ?>
</footer>
</section>
我想用ajax
展示一些你的代碼,以便能夠在東西 – Dmonix 2013-04-08 08:56:10
http://malsup.com/jquery/form/工作 – 2013-04-08 09:13:48