//--- funzioni Riconoscimento utente function fRiconoscimento() { $('#box_richiesta').hide(); $('#box_riconoscimento').show(); $('#email').val(''); $('#email').focus(); } //--- funzioni Annulla Riconoscimento utente function fAnnullaRiconoscimento() { $('#email').val(''); $('#box_riconoscimento').hide(); $('#box_richiesta').show(); } //--- Controllo campi obbligatori Box Riconoscimento function fCheckObbligatoriRiconoscimento() { var blnReturn = true; if ( $('#email').val() == "" ) { blnReturn = false; $('#lblemail').addClass('errore'); $('#lblemail').html("Campo obbligatorio"); alert( "Inserisci l'indirizzo email. \n" ); $('#email').focus(); return blnReturn; } else { $('#lblemail').addClass('conferma'); $('#lblemail').html('...'); //-- Ajax : inizio $.ajax({ url: 'include/ajax/checkContatto.php' , data: 'command=checkEmailCodici&email=' + $('#email').val() , success: function(data) { // Ritorno : Inizio update = data.split('|'); if( update[0] == 'checkEmailCodici' ) { if( update[1] == 1 ) { $('#lblemail').removeClass('errore').addClass('conferma'); $('#lblemail').html(""); fDomanda( ( update[3] ).toString(), ( update[2] ).toString() ); } else { blnReturn = false; $('#lblemail').removeClass('conferma').addClass('errore'); $('#lblemail').html("L'indirizzo non risulta inserito nel nostro archivio!"); } return blnReturn; } // Ritorno : Fine } }); //-- Ajax : inizio } } //--- funzioni Domanda di sicurezza function fDomanda( pstrDomanda, pstrEmail ) { if ( pstrDomanda == "" ) { alert( "La procedura di recupero automatico dei codici non risulta attiva." ); $('#box_riconoscimento').hide(); $('#email').val(''); $('#box_domanda').hide(); $('#box_richiesta').show(); } else { $('#box_riconoscimento').hide(); $('#box_domanda').show(); $('#email_verifica').val( pstrEmail ); $('#domanda').html( pstrDomanda ); $('#risposta').focus(); } } //--- Controllo campi obbligatori Box Domanda function fCheckObbligatoriDomanda() { var blnReturn = true; if ( $('#risposta').val() == "" ) { blnReturn = false; alert( "Inserisci la risposta. \n" ); $('#risposta').focus(); } return blnReturn; } //--- funzioni Riconoscimento utente da errore function fRiconoscimentoErrore( pstrEmail ) { $('#box_richiesta').hide(); $('#box_riconoscimento').show(); $('#email').val( pstrEmail ); alert( "La risposta non corrisponde. Riprova." ); //fCheckEmail(); } //--- funzioni Messaggio inviato function fMessage() { $('#box_richiesta').hide(); $('#box_message').show(); }