This question is locked. New answers and comments are not allowed.
Dear Friends,
I am using a jquery to fill the checked combobox ID's into an array using the below code.
My Issue is,the POST method execute Twise.ie,the jquery will execute 2 times so the ID gets duplicated.
How to prevent jquery double post
$(document).ready(function () {
//Select vendor Grid checkboxes state maintaining
$('#grvSelectVendor :checkbox').live('change', function (e) {
if (this.name == 'selectedVendor') {
var $check = $(this);
//console.log($check);
if ($check.is(':checked')) {
//add id to selectedVendorID.
selectedVendorID.push($check.val());
alert('hi'); //This will execute twise in a checkbox click
}
else {
//remove id from selectedJobIds.
selectedVendorID = $.grep(selectedVendorID, function (item, index) {
return item != $check.val();
});
}
}
});
});
Please help me...
Regards
Sreyas MN
I am using a jquery to fill the checked combobox ID's into an array using the below code.
My Issue is,the POST method execute Twise.ie,the jquery will execute 2 times so the ID gets duplicated.
How to prevent jquery double post
$(document).ready(function () {
//Select vendor Grid checkboxes state maintaining
$('#grvSelectVendor :checkbox').live('change', function (e) {
if (this.name == 'selectedVendor') {
var $check = $(this);
//console.log($check);
if ($check.is(':checked')) {
//add id to selectedVendorID.
selectedVendorID.push($check.val());
alert('hi'); //This will execute twise in a checkbox click
}
else {
//remove id from selectedJobIds.
selectedVendorID = $.grep(selectedVendorID, function (item, index) {
return item != $check.val();
});
}
}
});
});
Please help me...
Regards
Sreyas MN