Dear All
I am displaying list of records
- <?php $i=0;
- do { $i++;
- if ($i==2) { $i=0; $bgclr="#c2c2c"; } else {$bgclr="#ffffff";}
- ?>
- <tr bgcolor="<?php echo $bgclr;?>">
- <td> <table width="100%" border="0" cellspacing="1" cellpadding="0">
- <tr class="textselected" id=<?php echo $rows['id'];?>>
- <td width="75%"><?php echo $rows['name'];?><span class="whitelabel">
- <input type="text" class="entryid" value="<?php echo $rows['id'];?>" />
- </span></td>
- <td class="close" style="cursor:pointer">Del<?php echo $rows['id'];?></td>
- </tr>
- </table>
- </td> </tr>
-
- <?php } while ($rows = mysql_fetch_assoc($Result)); ?>
My JQUERY
- $(".textselected").click(function () {
- var thisid= this.id ; //I want to delete record of this ID .. but could not pass on or get it when 'yesdelete' is clicked
- $('#askfordelete').show(); // displaying div to ask whether to delete or not ..this div is listed below
- });
-
- $("#yesdelete").click(function () {
- // alert("text cliecked for delete");
-
- // how to get variable thisid here ?
- $('#askfordelete').hide();
- $('#loadimage').show();
- var url = "delheaderrefresh.php"
- var data = {
- recordid: $('#recordid').val(),
- id:this.id
- };
- $('#selectheaderdiv').load(url, data,refreshdata, hideloading );
-
- });
-
- $("#nodelete").click(function () {
- $('#askfordelete').hide();
- });
- function hideloading() {
- $('#loadimage').hide();
- $('#keyword').val('');
- }
the div to ask whether to delete this record or not
- <div id="askfordelete" style="display:none; background-color:#006699; position:absolute; width:226px; height:102px; left: 66px; top: 121px; z-index:10000;">
- <table width="100%" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000">
- <tr>
- <td height="40" bgcolor="#E1F0F0"><table width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td height="50" colspan="5" align="center" bgcolor="#990000"><span class="SLOGAN">Delete this Record </span></td>
- </tr>
- <tr>
- <td height="18" colspan="5" align="center" > </td>
- </tr>
- <tr>
- <td width="9%" align="center" > </td>
- <td width="33%" height="47" align="center" class="a_demo_two" id="yesdelete">Yes</td>
- <td width="15%" align="center" > </td>
- <td width="35%" align="center" class="a_demo_two" id="nodelete"> No</td>
- <td width="8%" align="center" > </td>
- </tr>
- <tr>
- <td height="10" colspan="5" align="center" > </td>
- </tr>
- </table></td>
- </tr>
- </table>
- </div>
Please help