Revision: 43191
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 18, 2011 18:10 by erraja_07
Initial Code
function toggleChecked(status,mode) { $("div#" + mode + "_selected_emails INPUT[type='checkbox']").each( function() { $(this).attr("checked",status); var obj_id = $(this).val(); var photo = $('#'+mode+'_img_'+obj_id).attr('src'); var name = $('#'+mode+'_name_'+obj_id).html(); var uname = $('#'+mode+'_uname_'+obj_id).val(); var email = $('#'+mode+'_email_'+obj_id).val(); var user_id = $('#'+mode+'_id_'+obj_id).val(); var ids = $('[id='+mode+'_selected_'+obj_id+']'); if(status == true) { if(ids.length==0) { var content = '<div style=" border-bottom:1px solid #CCCCCC;float:left;padding:5px;width:97%;" id="'+mode+'_selected_'+obj_id+'"><div style="width:10%; float:left; padding-top:5px;cursor:pointer;" onClick="$(\'#'+mode+'_selected_'+obj_id+'\').remove();$(\'#'+mode+'_list_'+obj_id+'\').attr(\'checked\',false);"><img src="images/default/community/delete-icon.jpg"></div><div style="width:10%; float:left"><a href="#"><img src="'+photo+'"></a></div><div style="width:80%; float:left; padding-top:5px;font-weight:bold;">'+name+'<input name="email[]" type="hidden" value="'+email+'"/><input name="user_id[]" type="hidden" value="'+user_id+'"/><input name="name[]" type="hidden" value="'+uname+'"/></div></div>'; $(content).appendTo('#'+mode+'_selected_email_container'); } } else { $('#'+mode+'_selected_'+obj_id).remove(); } }) } function addSelected(obj,mode) { var obj_id = obj.value; var photo = $('#'+mode+'_img_'+obj_id).attr('src'); var name = $('#'+mode+'_name_'+obj_id).html(); var uname = $('#'+mode+'_uname_'+obj_id).val(); var email = $('#'+mode+'_email_'+obj_id).val(); var user_id = $('#'+mode+'_id_'+obj_id).val(); if(obj.checked == true) { var content = '<div style=" border-bottom:1px solid #CCCCCC;float:left;padding:5px;width:97%;" id="'+mode+'_selected_'+obj_id+'"><div style="width:10%; float:left; padding-top:5px;cursor:pointer;" onClick="$(\'#'+mode+'_selected_'+obj_id+'\').remove();$(\'#'+mode+'_list_'+obj_id+'\').attr(\'checked\',false);"><img src="images/default/community/delete-icon.jpg"></div><div style="width:10%; float:left"><a href="#"><img src="'+photo+'"></a></div><div style="width:80%; float:left; padding-top:5px;font-weight:bold;">'+name+'<input name="email[]" type="hidden" value="'+email+'"/><input name="user_id[]" type="hidden" value="'+user_id+'"/><input name="name[]" type="hidden" value="'+uname+'"/></div></div>'; $(content).appendTo('#'+mode+'_selected_email_container'); } else { $('#'+mode+'_selected_'+obj_id).remove(); } }
Initial URL
Initial Description
Initial Title
JQuery Move Selected items from Select Box
Initial Tags
Initial Language
JavaScript