attr('checked', true) doesn't work on modal

attr('checked', true) doesn't work on modal

Hello Jake;

Onclick 2 things happen:

1 - I check a radio button which is inside a modal
2 - Open the modal that shows a list of radio buttons

  1. onclick="select_checked_radio('119', 'link'); open_direct_purchase_item_model('119', 'link', 6, 319,0)"


The problem is that even though the source shows checked = "checked" but it is not checked in the modal.

  1. function select_checked_radio(item_id, p_type)
  2.   {
  3.     $('.profiles_checkboxes').attr('checked', false);
  4.         if(item_id.length>0 && p_type.length>0)
  5.           {
  6.             $('#'+p_type+'_'+item_id).attr('checked', true);
  7.           }
  8.   }
  9. function open_direct_purchase_item_model(item_id, p_type, id, active_item_shopping_cart_id, custom_product)
  10.     {
  11.        
  12.         $("#is_custom_product").val(custom_product);
  13.         $("#active_item").val(id);
  14.         $("#active_item_shopping_cart_id").val(active_item_shopping_cart_id);
  15.         $("#non_linked_item_"+id).val(id);
  16.        
  17.           $("#upload_direct_item_purchase_modal").modal();
  18.        
  19.     }


I did what was recommended here http://stackoverflow.com/questions/20470212/checked-radio-buttons-not-working-right-in-jquery-modal-dialog but didn;t work.

What would you do?

Thanks