DrTrans Posted December 3, 2013 Share Posted December 3, 2013 (edited) So i have 2 files I'm working with I need to get ReportID to the Modal.php ajax handler modal.php <! Request Application !> <div class="modal small hide fade" id="ReportModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-header"> <button type="button" class="pull-right btn " data-dismiss="modal" aria-hidden="true">×</button> <h3 id="myModalLabel">Get Report</h3> </div> <div class="modal-body"> <script type="text/javascript"> $.ajax({ cache: false, type: 'POST', url: 'ajax/getReport.php', data: 'id='+reportID, success: function(invdata) { $('#report').show().html(invdata); } }); </script> <div id="report"></div> </div> </div> Edited December 3, 2013 by DrTrans Quote Link to comment https://forums.phpfreaks.com/topic/284476-passing-variable-to-modal/ Share on other sites More sharing options...
DrTrans Posted December 3, 2013 Author Share Posted December 3, 2013 (edited) Heres the second part .. don't know why its doing it. custom.js $("#GetReport").click( function (data) { ReportID = $('#reportID').val(); data.preventDefault(); $('#ReportModal').modal({content: data}); }); Edited December 3, 2013 by DrTrans Quote Link to comment https://forums.phpfreaks.com/topic/284476-passing-variable-to-modal/#findComment-1461072 Share on other sites More sharing options...
Solution DrTrans Posted December 3, 2013 Author Solution Share Posted December 3, 2013 Thanks. I have fixed this. added $("#ReportModal").on('shown', function () { }); Quote Link to comment https://forums.phpfreaks.com/topic/284476-passing-variable-to-modal/#findComment-1461076 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.