我能夠將變量傳遞到模式底部的引導程序3模式,它表示id =「callId」,但是如何將callID傳遞給模式,其中我有$ test = callId。將變量傳遞到Bootstrap模式
<a data-id="<?=$sid?>" data-conf="<?=$call_conf?>" class="open-AddCallDialog btn btn-success btn-xs" href="#addCallDialog">Call Borrower</a>
jQuery的腳本
$(document).on("click", ".open-AddCallDialog", function (e) {
e.preventDefault();
var _self = $(this);
var myCallId = _self.data('id');
$("#callId").val(myCallId);
$(_self.attr('href')).modal('show');
});
模態
<div class="modal fade" id="addCallDialog"> tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="myModalLabel">Call Borrower</h4>
</div>
<div class="modal-body">
<div class="row well">
$test = call_conf;
</div>
</div>
<div class="modal-footer">
<input name="id" id="callId" type="hidden" value=""/>
<input name="pid" type="hidden" value="<?php echo $pid;?>"/>
<input name="processtp" type="hidden" value="callborrower"/>
<button id="submit" class="btn btn-primary btn-block btn-xs center">Update</button>
</div>
</form>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
這對我來說不是很清楚。你能修復語法並解釋你想獲得什麼嗎? – 2014-11-04 08:29:25