我有带有输入按钮的动态表,如下所示:
<div id="pesertakegiatan">
<button id="simpan" value="Simpan" style="float:right;" class="push_button blue">Simpan Kegiatan</button>
<input id="idkegiatan1" name="idkegiatan1" value="1" type="hidden">
<table id="tablehasil" class="display" style="width:100%;">
<thead>
<tr>
<th>Nama</th>
<th>AKD</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$dsql="select * from tabel_anggota order by id asc";
$dquery=mysql_query($dsql);
while($dassoc=mysql_fetch_assoc($dquery)){
$nama=$dassoc['NAMA'];
$id=$dassoc['ID'];
echo'
<tr class="pesertaAcara">
<td>'.$nama.'</td>
<td>
<select class="akdanggota" name="akdanggota"> ';
$sqlcariakd="select b.ID, b.NAMA_AKD from akd_anggota a, tabel_akd b where a.id_anggota='$id' and a.id_akd=b.id";
$qcariakd=mysql_query($sqlcariakd);
while($rowk=mysql_fetch_assoc($qcariakd)){
$idakdnya=$rowk['ID'];
$namaakdnya=$rowk['NAMA_AKD'];
echo'
<option value="'.$idakdnya.'">'.$namaakdnya.'</option>
';
}
echo ' </select>
</td>
<td><button class="inputpst" onclick>Input</button></td>
</tr>
';
}
echo '</tbody>';
echo '</table>';
?>
</div>
和
$('.inputpst').click(function() {
var akda = $(this).parents("tr").find(".akdanggota").val
var ida = $(this).val();
var idkeg = $('#idkegiatan1').val();
var aksi = "akdnya"
$.ajax({
url:"inputacara.php",
method:"POST",
data: {
idkeg:idkeg,
ida:ida,
akda:akda,
aksi:aksi
},
success:function(response){
alert("sukses");
}
});
});
我想要的是当我点击输入按钮然后行上的现有数据将被输入数据库,但是当我点击输入按钮时我得到了这个错误
未捕获的TypeError:无法读取属性&#39; toLowerCase&#39;未定义的
我正在使用jquery-1.12.4.min.js