var listId = '3';
var groupId = '';
var confirmReq = 'false';
var subUrl = 'f7c2h.emailsp.com/frontend/xmlSubscribe.aspx/?source=generic';
/*
validate form
*/
if(!(sub_email.match(/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,63})$/)))
{
selectedForm.find('.show-response').html('Indirizzo mail non valido');
viewInfoIcon('info', selectedForm);
return false;
}
/*
Check terms and conditions have been checked
*/
var termsAccept = '';
if(jQ('.terms-confirm').is(':checked') == false)
{
selectedForm.find('.show-response').html('Dai il consenso alle condizioni d\'uso');
viewInfoIcon('info', selectedForm);
return false;
}
else
{
termsAccept = jQ('.terms-confirm').val();
}
/*
Check other terms and conditions have been checked
*/
var terms2Accept = '';
terms2Accept = 'yes';
selectedForm.find('.loading-img').css('display', '');
viewInfoIcon('loading', selectedForm);
selectedForm.find('.show-response').html('Sending request...');
jQ.post('https://studiobracciali.com/wp-content/plugins/wp-mailup/subscribe.php', form_values, function(returned_data){
switch(Number(returned_data))
{
case 0:
selectedForm.find('.show-response').html('Ok, ora sei iscritto alla nostra newsletter!
');
break;
case 1:
selectedForm.find('.show-response').html('Errore generico ');
break;
case 2:
selectedForm.find('.show-response').html('Indirizzo mail non valido');
break;
case 3:
selectedForm.find('.show-response').html('Utente già iscritto!');
break;
case 10:
selectedForm.find('.show-response').html('Dai il consenso alle condizioni d\'uso');
break;
case 11:
selectedForm.find('.show-response').html('dai il consenso ai termini d\'uso aggiuntivi');
break;
case -1011:
/* here generic message is displayed instead of a detailed message, which can be misleading for subscribers */
selectedForm.find('.show-response').html('Errore generico ');
/*jQ('.show-response').html('IP address validation is required. Please check this page');*/