There are multiple input fields in the form for data display. Now click the button to submit some data, but some fields in the form do not need to be submitted. How to deal with it. Usually all submissions are submitted using ajax's serial number, such as $('form').serialize(). Now I only need to submit some fields and I don’t know how to write them. Please give me some advice!
我想大声告诉你2017-05-19 10:22:04
Jquery serialization is for elements with name attributes. If you want to remove some fields without submitting them, just remove the name attributes. This data will not be submitted when submitting.
PHP中文网2017-05-19 10:22:04
Take out the value to be submitted and submit it as a json array
$.post{url,{a:'a',b:'b',c:'c'},function(){}}
我想大声告诉你2017-05-19 10:22:04
Write a few more froms to submit as needed, or take the required values and submit them, or take all the values and then filter them,
or set the input attributes that do not need to be submitted to disabled.
某草草2017-05-19 10:22:04
var formData = $.param({
actionID : 'publishExam',
classInfo : getCheckedVal("classInfoName").toString(),
bookletUnitInfo : getRadioVal("unitradio")
}) + "&" + $("#examForm").serialize();
For reference!