Anzeige Empfänger bei Mailversand
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
|
||||
$(document).ready(function (e){
|
||||
$("#frmEnquiry").on('submit',(function(e){
|
||||
e.preventDefault();
|
||||
@ -5,10 +6,12 @@
|
||||
var valid;
|
||||
valid = validateContact();
|
||||
if(valid) {
|
||||
var dataString = new FormData(this);
|
||||
dataString.append('function', 'sendmail');
|
||||
$.ajax({
|
||||
url: "../controller/admin_phpmailer.php",
|
||||
type: "POST",
|
||||
data: new FormData(this),
|
||||
data: dataString,
|
||||
contentType: false,
|
||||
cache: false,
|
||||
processData:false,
|
||||
@ -20,6 +23,7 @@
|
||||
$('.selectpicker').selectpicker('deselectAll');
|
||||
document.getElementById("subject").value ="";
|
||||
tinyMCE.get(0).setContent("");
|
||||
$('#empf').html('');
|
||||
}
|
||||
$('#msg').show().delay(5000).fadeOut(500);
|
||||
$('#msg').html(a[0]);
|
||||
@ -84,3 +88,54 @@
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
function showmail(){
|
||||
//komma getrennte Werte bei Mehrfachauswahl
|
||||
var empfaenger = $("#empfaenger").val();
|
||||
if(empfaenger != ''){
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '../controller/admin_phpmailer.php',
|
||||
data: {
|
||||
'function': 'showmail',
|
||||
'empfaenger': empfaenger
|
||||
},
|
||||
success: function(result) { //we got the response
|
||||
if(result !=''){
|
||||
var name = "";
|
||||
var mail = "";
|
||||
var komplett = "";
|
||||
var result_array = result.split(',');
|
||||
for(var i = 0; i < result_array.length; i++) {
|
||||
// Trim the excess whitespace.
|
||||
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.substring(0,name.length-2);
|
||||
mail = mail.substring(0,mail.length-2);
|
||||
komplett = komplett.substring(0,komplett.length-2);
|
||||
$('#empf').html(name);
|
||||
document.getElementById("mailhidden").value = mail;
|
||||
document.getElementById("komplett").value = komplett;
|
||||
}
|
||||
},
|
||||
error: function(xhr, status, exception) {
|
||||
console.log(xhr);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function test(){
|
||||
//komma getrennte Werte bei Mehrfachauswahl
|
||||
alert('hier');
|
||||
$('#empf').html('klappt');
|
||||
|
||||
}
|
Reference in New Issue
Block a user