javascript - Open Jquery Dialogue box with unique id -
i want open jquery dialogue box unique id. cannot figure out. problem not opening using unique identifier. want open using id attribute.in other words want uniquely identify link click , div/dialogue box. please.
what did is:
javascript code:
$(function() { $(".dialog").dialog({ autoopen: false, maxwidth:600, maxheight: 500, width: 600, height: 300, dialogclass: 'main-dialog-class', modal: true }); $("a.to").on("click", function() { var id=$(this).attr('id'); alert(id); $(this).parent().find(".dialog").dialog("open"); }); });
php code.
<table> <?php foreach($tlist $ts) : ?> <tr> <td> <div class="dialog" id="<?php echo $tenders["tender_id"]; ?>" title="dialog form"> <?php $sql1="select * table id='".$ts["id"]."'" ; $result1=mysqli_query($link,$sql1); while($rows=mysqli_fetch_array($result1)){ echo $rows["t1"]; ?> <a href="download.php?filename=<?php echo $rows['path'] ;?>" target="_blank"><?php echo $rows['name'];?></a><br/> <?php } ?> </div> </td> <td style="display:none"> <?php echo $ts["id"]; ?> </td> <td> <a href="#" class="to" id="<?php echo $tenders["tender_id"]; ?>" > <?php echo $tenders["title"]; ?></a> </td> <td> <?php echo $ts["t1"]; ?> </td> <td> <?php echo $ts["t2"]; ?> </td> </tr> <?php endforeach; ?> </table>
Comments
Post a Comment