I have many rows of data. Each row has 3 cells – id, eesnimi, perenimi. I want to be able to inline edit all of the cells. I am using In place editor.
How can I get specific cells (the cell I am editing at the moment) id to javascript (element_id field), so I know which element to change in mysql.
Javascript:
$(document).ready(function(){
$(".editme1").editInPlace({
url: 'http://localhost/petka/kast.php',
element_id: ??????,
show_buttons: true
});
});
HTML:
<table>
<?PHP
$sql="SELECT * FROM nimed";
$result = mysql_query($sql)or die(mysql_error());
WHILE ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
echo '<tr class="row">';
echo '<td class="editme1" id="id|'.$row["id"].'" title="id">'.$row["id"].'</td>';
echo '<td class="editme1" id="eesnimi|'.$row["id"].'" title="eesnimi">'.$row["eesnimi"].'</td>';
echo '<td class="editme1" id="perenimi|'.$row["id"].'" title="perenimi">'.$row["perenimi"].'</td>';
echo '</tr>';
}
?>
</table>
Have you used