Home > Article > Web Front-end > Form submission, only submit the rows selected by the check box_html/css_WEB-ITnose
There are multiple pieces of data traversed using e90145dd58c42c9bf37ce744c0a96dfd in the form. There is a checkbox on the form. How can I submit only the rows of data I selected? ? ?
I found that he would submit everything once I submitted it. But only the selected checkboxes are on, and the unselected ones are not
In the submission event, remove the names of the unselected rows
Thank you for the reminder! ! ! ! Solved
This is the method code
$("#jiesuan").click(function(){ alert("结算"); //复选框的name='od' $("input[name='od']").each(function(){ if($(this).attr("checked")== 'checked'){ //是选中 }else{ // td tr $(this).parent().parent().find("input").removeAttr("name"); } }); });