Kayıt silme tıklama üzerinde div etiketini yenilemek

0 Cevap php

Ben, PDO, PHP prototype.js kullanıyorum. i ajax kullanarak yenileme ile kayıtları silmek istiyorum

index.php

     <?php if(!isset($studentVoList)||count($studentVoList)==0){?>
		<tr><td colspan="3" align="center">No records found.</td></tr>
		<?php } else {
			foreach($studentVoList as $studentVo) {
		?>
		<tr>
		<td align="center"><?php echo $studentVo->id;?></td>
		<!--td align="center"><?php echo "1";?></td-->
		<td>
		<Select NAME="CoId"	>
		    <Option VALUE="Item1">1</option>
		    <Option VALUE="Item2">2</option>
	    	<Option VALUE="Item3">3</option>
		</Select>


		</td>
		<td align="center"><?php echo $studentVo->st_name;?></td>
		<td align="center"><?php echo $studentVo->st_city;?></td>
		<td align="center"><?php echo $studentVo->st_created;?></td>
		<td align="center"><?php echo $studentVo->st_modified;?></td>

		<td align="center">
		<a href="javascript: submitForm('<?php echo $studentVo->id?>','view')">Edit</a></td>
		<td align="center">
		<!--a href="javascript: submitForm('<?php //echo $studentVo->id?>','delete')">Delete</a></td-->
		<a href="javascript: deleteId('<?php echo $studentVo->id?>')">Delete</a></td>

		</tr>
		<?php 
		}
		}
       ?>

script

     function deleteId(id){

     alert("Id:="+id);
      var myAjax = new Ajax.Request('delete.php',{method:'post',parameters: 'action='+ id});

    }

Silmek yapılır ama ben yeniledikten sonra, ben silme düğmeye tıklayın kodunu yenilemek istiyorsun

0 Cevap