jasmine825 jasmine825 - 2 months ago 5x
HTML Question

Information to display in a dialog box not another page

How can I make each button instead of going to another page to display the information on a dialog box in the same page.
This code here is in the head to call the id from the other file

<script type="text/javascript">

function getvoucher(id){

$.get("" + id, function(data,status){

return data;




Then I have this button in my while loop:

<td><?php echo $row['voucher_id']; ?></td>
<td> <?php echo'<a href="test.php?id=' . $row['voucher_id'] . '"> Click here</a>'; ?></td>

When I click on the button it displays what I want in test but instead I want it to show in a dialog box, any help?


try this:

$.get("demo_test.php", function(response){
    // this will put your response to popup div

    // now popup it
        title   : 'Title',
        width   : 400,
        height  : 400,
        modal   : true,
        closeOnEscape: false

<div id="popup"></div>