DrTrans Posted December 3, 2013 Share Posted December 3, 2013 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> 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 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}); }); Link to comment https://forums.phpfreaks.com/topic/284476-passing-variable-to-modal/#findComment-1461072 Share on other sites More sharing options...
DrTrans Posted December 3, 2013 Author Share Posted December 3, 2013 Thanks. I have fixed this. added $("#ReportModal").on('shown', function () { }); Link to comment https://forums.phpfreaks.com/topic/284476-passing-variable-to-modal/#findComment-1461076 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.