Code submitted by serialization of from forms in JS, and js serialization
If you don't talk much about it, paste the Code directly. The specific code is as follows:
// ---- Ajax begin $. ajax ({type: "POST", url: "../compRule/updateRuleById? Tids = "+ compTableName_val +" & isReportName = "+ $ ('# isReport_update '). val () + "& heji_add =" + $ ('# heji_update '). val (), async: false, data: $ ("# update_form1 "). serialize (), dataType: "text", success: function (data) {$ ("# search "). click (); $. success ("operation successful"); setTimeout (function () {layer. closeAll () ;}, 1000) ;}, error: function (data) {$. fail ('Operation failed! ') ;}}); // ---- Ajax end
Submit it to the background using ajax. If the serialization fails to receive the corresponding value, or the value is Null, the value will be put on the url.
The above section describes the code for serializing and submitting from forms in Javascript. I hope it will be helpful to you. If you have any questions, please leave a message and I will reply to you in a timely manner. Thank you very much for your support for the help House website!