Adsense
Popular Posts
- MySQL workbench -"Could not decrypt password cache"
- mod_auth_cas.so error: undefined symbol: SSL_connect
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- JavaScript Arrays and Associate Arrays
- Design date and signature box in Latex
- Install APXS in Redhat Linux
- super(props) in React
- jQuery, toggle the display
- PHP function for input sanitizing
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:
Posts (Atom)