foreach ループによって行が生成されるテーブルがあります。
テーブルの各行には 2 つの列があり、1 つはフォーム、もう 1 つはフォームから送信されたデータ (メモと呼びます) です。(ブラウザを更新せずに jQuery ライブラリを使用して更新します)。
<script>
$(".notes_column").each(function(){
var $myform = $(this).find('.notes_form');
var $mynotes = $(this).find('.notes');
$myform.validate({
submitHandler: function(form) {
$.post('process.php', $myform.serialize(), function(data) {
$mynotes.html(data);
});
}
});
}); // each function
</script>
<table id="myTable" class="tablesorter" border="1" cellpadding="5">
<thead>
<tr>
<th>Notes</th>
<th>Submit Note</th>
</tr>
</thead>
<tbody>
<?php
foreach($myarray as $myvar){
echo '
<tr>
<td>ID LIKE TO PLACE THE content of the div class="notes" HERE, HOW CAN I DO IT?</td>
<td class="notes_column">
<form class="notes_form" action="" method="post">
<input class="q" type="text" name="notes" size="30" placeholder="Place your notes here..." />
<input class="searchsubmit" type="submit" name="submit" value="Submit" />
</form>
<div class="notes"></div>
</td>
</tr>
';
}
?>
</tbody>
</table>
現在、各テーブル列を反復するjQueryの各関数を使用し、クラス名「.notes_column」の列ごとに、送信されたデータをクラス「notes」でdivに入力します。
質問は大文字でコード内にリストされています。他の列にフォーム送信データを入力するにはどうすればよいですか?
何か案は?
タイ