Adsense
Popular Posts
- MySQL workbench -"Could not decrypt password cache"
- Install APXS in Redhat Linux
- react-pdf, display pdf in react.js
- Set Windows path command line
- MySQL date created and date modified
- Transfer modules between sites
- DataTable table order by numeric, not by text
- datatable order by nunmeric
- mod_auth_cas.so error: undefined symbol: SSL_connect
- JavaScript, remove trailing insignificant zeros after toFixed function
Wednesday, September 2, 2015
jQuery, combine form serialize data with other variables
We use following for form data in post
$("div.ajax_list form#" + formName).serialize();
to add variables such as formName
var data0 = $("div.ajax_list form" + formName).serializeArray();
data0.push({name: 'formName', value: formName});
Complete example code:
function submitUpdateForm(formName){
var data0 = $("div.ajax_list form" + formName).serializeArray();
data0.push({name: 'formName', value: formName});
$.post('../../_ajaxParts/System/lut_termnew.php', data0, function(data) {
formatJson(data, '#notice');
submitFilterForm();
});
}
Subscribe to:
Comments (Atom)