Is it posable to pass data to a modal the can be used in a php script to run a query
This script will pass two variable into a modal but I can't figure out how to use one of them in a PHP script.
l what to use it like this $call_conf = callconf . How can I pass the data to $call_conf variable. The id I can add it to the modal like using it for <input name="id" id="callId" type="hidden" value=""/> and this works with no problem. You can see where I wont to add this in modal below. Is this even possible?
LINK
- <a data-id="<?=$sid?>" data-conf="<?=$call_conf?>"class="open-AddCallDialog btn btn-success btn-xs" href="#addCallDialog">Call Borrower</a>
JQuery Script
- $(document).on("click", ".open-AddCallDialog", function (e) {
- e.preventDefault();
- var _self = $(this);
- var myCallId = _self.data('id');
- $("#callId").val(myCallId);
-
- var myCallconf = _self.data('conf');
- $("#callconf").val(myCallconf);
- $(_self.attr('href')).modal('show');
- });
MODAL
- <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">
<form action="formpross.php" id="closeform" method="post" class="form-horizontal" role="form">
-
<?php $call_conf = callconf; ?> <--- I am trying to pass the data to this variable
-
<select name="call_conf" class="form-control input-sm">
<option>Select Confirmation</option>
<option <?php if ($call_conf == 1)
echo 'selected'; ?> value="1">Confirmed</option>
<option <?php if ($call_conf == 2)
echo 'selected'; ?> value="2">Left Message</option>
<option <?php if ($call_conf == 3)
echo 'selected'; ?> value="3">No Answer</option>
</select>
</div>
</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>