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!
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.
Use
jQuery
获取部分input
的value
Then send the data
Split it into two forms so that you can submit them separately
Take out the value to be submitted and submit it as a json array
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.
For reference!