I have following table where each row has a unique ID. Now I want, if I click to Remove link the row ID will pass to a PHP file t remove record from MySQL DB and then selected row will just hide with JQuery magic.
<table id="projects_rec">
<tbody>
<tr id="MjY=">
<td>Dany</td>
<td><a onClick="remove('MjY=')" class="actions">Remove</a></td>
</tr>
<tr id="MjU=">
<td>King</td>
<td><a onClick="remove('MjU=')" class="actions">Remove</a></td>
</tr>
<tr id="MjQ=">
<td>Test 2</td>
<td><a onClick="remove('MjQ=')" class="actions">Remove</a></td>
</tr>
</tbody>
</table>
I wrote
function remove(mid){
document.getElementById(mid).style.display='none';
}
but how do it pass ID to PHP file and then hide TR with SLOW effect?
You can use jquery to hide the ID by using:
$('#'+id).hide('slow');assuming that your javascript function remove looks similar to this.