0
JQuery를 사용하여 단추를 클릭하여 양식을 채우는 페이지가 있습니다. 이 양식에는 두 개의 텍스트 상자와 제출 단추가 있지만 제출 단추를 클릭하면이 양식을 제출할 수 없습니다. 누군가이 문제를 해결할 수 있도록 도와주세요.JQuery에 의해 생성 된 양식 동작이 작동하지 않습니다.
$(document).ready(function() {
edittr = function (id) {
var oldhtml = $(".tr-" + id).html();
$(".tr-" + id + " td").each(function() {
if ($(this).attr("id") == "td-edit-" + id) {
$(this).html("<button class='btn btn-sm btn-primary' type='submit' onclick='onupdateclick(" + id + ")'><i class='fa fa-save'></i> UPDATE</button> " +
"<input type='hidden' name='MaterialID' id='MaterialID' value='" + id + "' />" +
"<button class='btn btn-sm btn-default' type='button'>CANCEL</button>");
}
if ($(this).attr("id") != "td-edit-" + id) {
$(this).html("<label class='input'><input type='text' name='" + $(this).attr("itemid") + "' value='" + $(this).text() + "' /></label>");
}
});
}
몇 가지 코드를 제공해 주시겠습니까? 고마워. –