Я создал таблицу из данных, возвращаемых как json из файла php, используя ajax.
Эта таблица содержит форму из двух столбцов каждой строки, которая снова вызывает php файл в действии. это действие формы не работает.
function get_data() {
var compnm=$('#compnm').val();
$.ajax({
type: "POST",
url: "mchdet.php", // Name of the php files
data: {
compnm:compnm
},
dataType:'json',
success: function(jsn)
{
var html = "",val="";
var html = '<thead>'+
'<tr>'+
'<th><strong>S.No.</strong></th>'+
'<th><strong>Company</strong></th>'+
'</tr>'+
'</thead>'+
'<tbody>';
$.each(jsn, function(index)
{
console.log(jsn[index].COMPNM);
var a = index + 1;
html = html + '<tr> <td align="center"> '+a+'</td> '+
'<td align="center">'+jsn[index].COMPNM+'</td>'+
'<form action="edtmch.php" method = "POST" onsubmit="alert("Called onsubmit");">'+
'<td>'+
' <input type="radio" name ="del" id="del" value = "shift">Shift<br/>'+
' <input type="radio" name ="del" id="del" value = "expire">Expire'+
'</td>'+
'<td> '+
' <input type="hidden" name = "id" id="id" value = '+jsn[index].ID+'</input>'+
' <input type = "submit" name = "submit" value = "Edit" ></input>'+
'</td>'+
'</form>'+
'</tr>';
});
html = html + '</tbody></table>';
$("#get_data").html(html);
}
});
return false;
}
html используется для отображения таблицы
<div id="get_data"></div>
Данные отображаются отлично, но проблема заключается в том, что действие формы даже при отправке оповещения также не отображается не работает