TechGuy TechGuy - 1 year ago 63
Javascript Question

Pass values to bootstrap modal in jquery success function

I have a Bootstrap modal inside jquery success function.I want to show
some value in the modal.

My Modal:

<div class="modal fade" id="REQModal" role="dialog" data-backdrop="static" data-keyboard="false">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header btn-danger">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h4 class="modal-title">Error Message</h4>
<div class="modal-body">
<div id="num"></div>
<p>Error has occured!.</p>

<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
My Jquer

My function:

url: $('#addRequest').val(),
type: "POST",
data: { Request: Request },
dataType: "json",
success: function (refNo) { // refNo comes here.
$("#REQModal").modal('show'); // modal popup's but refNo doesn't show.

Answer Source



instead of

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download