Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // After defaults are checked, add event handler & enable checkbox
- jQuery('#attributes input[type="checkbox"]').bind('change', function() {
- jQuery(this).attr('disabled', 'disabled');
- if (this.checked) {
- jQuery.post(adminAjaxUrl, {
- action : "updateAttributeAssoication",
- sqlAction : 'insert',
- listingCategoryId : jQuery('#listing_categories').val(),
- attributeId : jQuery(this).val()
- }, function(results) {
- jQuery(this).removeAttr('disabled');
- });
- }
- if (!this.checked) {
- jQuery.post(adminAjaxUrl, {
- action : "updateAttributeAssoication",
- sqlAction: 'delete',
- listingCategoryId : jQuery('#listing_categories').val(),
- attributeId : jQuery(this).val()
- }, function(results) {
- jQuery(this).removeAttr('disabled');
- });
- }
- });
Add Comment
Please, Sign In to add comment