Fix destinatari modal invio mail

This commit is contained in:
MatteoPistorello 2021-11-05 16:13:29 +01:00
parent 6ce3509d58
commit ef58348f94
1 changed files with 5 additions and 2 deletions

View File

@ -87,7 +87,7 @@ echo '
foreach ($emails as $email) { foreach ($emails as $email) {
echo ' echo '
<div class="col-md-12"> <div class="col-md-12">
{[ "type": "email", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 1 ]} {[ "type": "email", "name": "destinatari['.$idx++.']", "value": "'.$email.'", "icon-before": "choice|email", "extra": "onkeyup=\'aggiungiDestinatario();\'", "class": "destinatari", "required": 0 ]}
</div>'; </div>';
} }
echo ' echo '
@ -166,9 +166,12 @@ echo '
if (id_anagrafica) { if (id_anagrafica) {
$(document).load(globals.rootdir + "/ajax_complete.php?module=Anagrafiche&op=get_email&id_anagrafica=" + id_anagrafica + (pec ? "&type=pec" : ""), function(response) { $(document).load(globals.rootdir + "/ajax_complete.php?module=Anagrafiche&op=get_email&id_anagrafica=" + id_anagrafica + (pec ? "&type=pec" : ""), function(response) {
emails = JSON.parse(response); emails = JSON.parse(response);
let num = 0;
$(".destinatari").each(function(){ $(".destinatari").each(function(){
addAutoComplete(this); addAutoComplete(this);
if (num++==0) {
$(this).prop("required", true);
}
}); });
aggiungiDestinatario(); aggiungiDestinatario();