I am working on basic functionality of insert,add,delete and update using ajax.
I have done little functionality write now..actually i want all functionality in a grid .
I put all html code inside a for loop.. this loop will execute till total num rows.. first execution of loop is fine, problem occur after this... next time when i click on delete button ajax call is not working.
Need help on this....
I have 2 files.. form.php and operation.php
code of form.php..
$(document).ready(function(){
$("#delete").click(function(){
var id=$("#uid").val();
$.post("operation.php",{ID:id},function(data){
$("#result").html(data);
});
});
});
for($i=0;$i<2;$i++)
{
echo "<input type='text' value=".mysql_result($all_records, $i, "id")." name='uid' id='uid'>
<input type='text' value=".mysql_result($all_records, $i,"name")." name='name' id='email' placeholder='Email'>
<input type='text' value=".mysql_result($all_records, $i,"email")." name='email' id='email' placeholder='Email'>
<input type='password' value=".mysql_result($all_records, $i,"password")." name='pass' id='pass' placeholder='Password'>
<input type='submit'name='delete' id='delete' value='Delete'>
<input type='submit'name='update' id='update' value='Update'>";
echo "</td></tr>";
}
operation.php
write now i put only one line code for checking purpose...
echo $_POST['ID'];