Adsense
Popular Posts
- Amazon web serive
- MySQL workbench -"Could not decrypt password cache"
- git svn conversion
- increase mysql query speed
- Unix Utils and wget in Windows
- add comment to table columns in phpMyAdmin
- Special characters pronunciation link
- deposit cheque in TD bank using Mobile phone
- Setup vi syntax for PHP
- Get WAMP running on EC2
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)