Adsense
Popular Posts
- Install APXS in Redhat Linux
- MySQL workbench -"Could not decrypt password cache"
- Transfer modules between sites
- JavaScript, remove trailing insignificant zeros after toFixed function
- Set Windows path command line
- datatable order by nunmeric
- MySQL date created and date modified
- super(props) in React
- PHP, dump varailbes in a format way
- React: connect(mapStateToProps, mapDispatchToProps)
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:
Post Comments (Atom)
No comments:
Post a Comment