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
- 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.
- function select_checked_radio(item_id, p_type)
- {
- $('.profiles_checkboxes').attr('checked', false);
- if(item_id.length>0 && p_type.length>0)
- {
- $('#'+p_type+'_'+item_id).attr('checked', true);
- }
- }
- function open_direct_purchase_item_model(item_id, p_type, id, active_item_shopping_cart_id, custom_product)
- {
-
- $("#is_custom_product").val(custom_product);
- $("#active_item").val(id);
- $("#active_item_shopping_cart_id").val(active_item_shopping_cart_id);
- $("#non_linked_item_"+id).val(id);
-
- $("#upload_direct_item_purchase_modal").modal();
-
- }
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