Home  >  Article  >  Web Front-end  >  Form submission, only submit the rows selected by the check box_html/css_WEB-ITnose

Form submission, only submit the rows selected by the check box_html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 11:57:211893browse

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? ? ?


Reply to discussion (solution)

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");		   	}		});    });

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn