static/js/ep_email.js
function(e){
      $('#ep_email_form_popup').submit(function(){
        sendEmailToServer('ep_email_form_popup');
        return false;
      });

      // Prepare subscription before submit form
      $('#ep_email_form_popup [name=ep_email_subscribe]').on('click', function(e) {
        $('#ep_email_form_popup [name=ep_email_option]').val('subscribe');
        checkAndSend(e);
      });

      // Prepare unsubscription before submit form
      $('#ep_email_form_popup [name=ep_email_unsubscribe]').on('click', function(e) {
        $('#ep_email_form_popup [name=ep_email_option]').val('unsubscribe');
        checkAndSend(e);
      });

      if (optionsAlreadyRecovered == false) {
        getDataForUserId('ep_email_form_popup');
      } else {
        // Get datas from form in mysettings menu
        $('#ep_email_form_popup [name=ep_email]').val($('#ep_email_form_mysettings [name=ep_email]').val());
        $('#ep_email_form_popup [name=ep_email_onStart]').prop('checked', $('#ep_email_form_mysettings [name=ep_email_onStart]').prop('checked'));
        $('#ep_email_form_popup [name=ep_email_onEnd]').prop('checked', $('#ep_email_form_mysettings [name=ep_email_onEnd]').prop('checked'));
      }
    }
function(e){
      $('#ep_email_form_popup').submit(function(){
        sendEmailToServer('ep_email_form_popup');
        return false;
      });

      // Prepare subscription before submit form
      $('#ep_email_form_popup [name=ep_email_subscribe]').on('click', function(e) {
        $('#ep_email_form_popup [name=ep_email_option]').val('subscribe');
        checkAndSend(e);
      });

      // Prepare unsubscription before submit form
      $('#ep_email_form_popup [name=ep_email_unsubscribe]').on('click', function(e) {
        $('#ep_email_form_popup [name=ep_email_option]').val('unsubscribe');
        checkAndSend(e);
      });

      if (optionsAlreadyRecovered == false) {
        getDataForUserId('ep_email_form_popup');
      } else {
        // Get datas from form in mysettings menu
        $('#ep_email_form_popup [name=ep_email]').val($('#ep_email_form_mysettings [name=ep_email]').val());
        $('#ep_email_form_popup [name=ep_email_onStart]').prop('checked', $('#ep_email_form_mysettings [name=ep_email_onStart]').prop('checked'));
        $('#ep_email_form_popup [name=ep_email_onEnd]').prop('checked', $('#ep_email_form_mysettings [name=ep_email_onEnd]').prop('checked'));
      }
    }
function ( e ) { $ ( '#ep_email_form_popup' ) . submit ( function ( ) { sendEmailToServer ( 'ep_email_form_popup' ) ; return false ; } ) ; // Prepare subscription before submit form $ ( '#ep_email_form_popup [name=ep_email_subscribe]' ) . on ( 'click' , function ( e ) { $ ( '#ep_email_form_popup [name=ep_email_option]' ) . val ( 'subscribe' ) ; checkAndSend ( e ) ; } ) ; // Prepare unsubscription before submit form $ ( '#ep_email_form_popup [name=ep_email_unsubscribe]' ) . on ( 'click' , function ( e ) { $ ( '#ep_email_form_popup [name=ep_email_option]' ) . val ( 'unsubscribe' ) ; checkAndSend ( e ) ; } ) ; if ( optionsAlreadyRecovered == false ) { getDataForUserId ( 'ep_email_form_popup' ) ; } else { // Get datas from form in mysettings menu $ ( '#ep_email_form_popup [name=ep_email]' ) . val ( $ ( '#ep_email_form_mysettings [name=ep_email]' ) . val ( ) ) ; $ ( '#ep_email_form_popup [name=ep_email_onStart]' ) . prop ( 'checked' , $ ( '#ep_email_form_mysettings [name=ep_email_onStart]' ) . prop ( 'checked' ) ) ; $ ( '#ep_email_form_popup [name=ep_email_onEnd]' ) . prop ( 'checked' , $ ( '#ep_email_form_mysettings [name=ep_email_onEnd]' ) . prop ( 'checked' ) ) ; } }
the function to bind to the form
the function to bind to the form