Empfängerliste löschen
This commit is contained in:
@ -16,6 +16,7 @@
|
||||
cache: false,
|
||||
processData:false,
|
||||
success: function(result){
|
||||
//alert(result);
|
||||
if(result!=''){
|
||||
var a = result.split('|***|');
|
||||
if(a[1]=="success"){
|
||||
@ -112,14 +113,15 @@ function showmail(){
|
||||
result_array[i] = result_array[i].replace(/^\s*/, "").replace(/\s*$/, "");
|
||||
// Add additional code here, such as:
|
||||
var name_array = result_array[i].split('|');
|
||||
//name += name_array[i][0] +"->"+ name_array[i][1]+",";
|
||||
name += name_array[0]+", ";
|
||||
mail += name_array[1]+", ";
|
||||
komplett += name_array[0]+"|"+name_array[1]+", ";
|
||||
name += name_array[0]+"<a href='#' class='settings text-danger' id='disable' onclick='deleteContact(\""+name_array[0]+"|"+name_array[1]+"\");' title='Kontalt entfernen' data-toggle='tooltip'><i class='fa fa-trash'></i></a>, ";
|
||||
mail += name_array[1]+"|";
|
||||
komplett += name_array[0]+"|"+name_array[1]+",";
|
||||
}
|
||||
name = name.substring(0,name.length-2);
|
||||
mail = mail.substring(0,mail.length-2);
|
||||
komplett = komplett.substring(0,komplett.length-2);
|
||||
//mail = mail.substring(0,mail.length-1);
|
||||
|
||||
// auskommentiert, das letzte Komma wird beim deleteContact ben<65>tigt: komplett_neu = komplett_neu.replace(contact+',' , '');
|
||||
//komplett = komplett.substring(0,komplett.length-1);
|
||||
$('#empf').html(name);
|
||||
document.getElementById("mailhidden").value = mail;
|
||||
document.getElementById("komplett").value = komplett;
|
||||
@ -133,9 +135,46 @@ function showmail(){
|
||||
}
|
||||
|
||||
|
||||
function test(){
|
||||
//komma getrennte Werte bei Mehrfachauswahl
|
||||
alert('hier');
|
||||
$('#empf').html('klappt');
|
||||
function deleteContact(contact){
|
||||
|
||||
}
|
||||
//komma getrennte Werte bei Mehrfachauswahl
|
||||
var komplett_neu = document.getElementById("komplett").value;
|
||||
komplett_neu = komplett_neu.replace(contact+',' , '');
|
||||
|
||||
//letztes Komma entfernen, damit die For Schleife nicht einmal zu viel durchl<68>uft
|
||||
komplett_neu = komplett_neu.substring(0,komplett_neu.length-1);
|
||||
|
||||
if(komplett_neu != ''){
|
||||
var name = "";
|
||||
var mail = "";
|
||||
var komplett = "";
|
||||
var komplett_neu_array = komplett_neu.split(',');
|
||||
//Alexander2 Schwarz2|alexander@ja-schwarz.de,Alexander3 Schwarz3|technik@ju-and-mi.de,
|
||||
|
||||
|
||||
for(var i = 0; i < komplett_neu_array.length; i++) {
|
||||
|
||||
// Trim the excess whitespace.
|
||||
komplett_neu_array[i] = komplett_neu_array[i].replace(/^\s*/, "").replace(/\s*$/, "");
|
||||
// Add additional code here, such as:
|
||||
var name_array = komplett_neu_array[i].split('|');
|
||||
//name += name_array[i][0] +"->"+ name_array[i][1]+",";
|
||||
name += name_array[0]+"<a href='#' class='settings text-danger' id='disable' onclick='deleteContact(\""+name_array[0]+"|"+name_array[1]+"\");' title='Kontalt entfernen' data-toggle='tooltip'><i class='fa fa-trash'></i></a>, ";
|
||||
mail += name_array[1]+"|";
|
||||
komplett += name_array[0]+"|"+name_array[1]+",";
|
||||
}
|
||||
name = name.substring(0,name.length-2);
|
||||
//mail = mail.substring(0,mail.length-1);
|
||||
|
||||
// auskommentiert, das letzte Komma wird beim deleteContact ben<65>tigt: komplett_neu = komplett_neu.replace(contact+',' , '');
|
||||
//komplett = komplett.substring(0,komplett.length-1);
|
||||
$('#empf').html(name);
|
||||
document.getElementById("mailhidden").value = mail;
|
||||
document.getElementById("komplett").value = komplett;
|
||||
}else{
|
||||
$('.selectpicker').selectpicker('deselectAll');
|
||||
$('#empf').html('');
|
||||
document.getElementById("mailhidden").value = '';
|
||||
document.getElementById("komplett").value = '';
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user