static/js/ep_email.js
function checkAndSend(e) {
  var formName = $(e.currentTarget.parentNode).attr('id');

  var email = $('#' + formName + ' [name=ep_email]').val();

  if (email && $('#' + formName + ' [name=ep_email_option]').val() == 'subscribe'
      && !$('#' + formName + ' [name=ep_email_onStart]').is(':checked')
      && !$('#' + formName + ' [name=ep_email_onEnd]').is(':checked')) {
    $.gritter.add({
      // (string | mandatory) the heading of the notification
      title: window._('ep_email_notifications.titleGritterError'),
      // (string | mandatory) the text inside the notification
      text: window._('ep_email_notifications.msgOptionsNotChecked'),
      // (string | optional) add a class name to the gritter msg
      class_name: "emailNotificationsSubscrOptionsMissing"
    });
  } else if (email) {
    $('#' + formName).submit();
  }
  return false;
}
function checkAndSend(e) {
  var formName = $(e.currentTarget.parentNode).attr('id');

  var email = $('#' + formName + ' [name=ep_email]').val();

  if (email && $('#' + formName + ' [name=ep_email_option]').val() == 'subscribe'
      && !$('#' + formName + ' [name=ep_email_onStart]').is(':checked')
      && !$('#' + formName + ' [name=ep_email_onEnd]').is(':checked')) {
    $.gritter.add({
      // (string | mandatory) the heading of the notification
      title: window._('ep_email_notifications.titleGritterError'),
      // (string | mandatory) the text inside the notification
      text: window._('ep_email_notifications.msgOptionsNotChecked'),
      // (string | optional) add a class name to the gritter msg
      class_name: "emailNotificationsSubscrOptionsMissing"
    });
  } else if (email) {
    $('#' + formName).submit();
  }
  return false;
}
function checkAndSend ( e ) { var formName = $ ( e . currentTarget . parentNode ) . attr ( 'id' ) ; var email = $ ( '#' + formName + ' [name=ep_email]' ) . val ( ) ; if ( email && $ ( '#' + formName + ' [name=ep_email_option]' ) . val ( ) == 'subscribe' && ! $ ( '#' + formName + ' [name=ep_email_onStart]' ) . is ( ':checked' ) && ! $ ( '#' + formName + ' [name=ep_email_onEnd]' ) . is ( ':checked' ) ) { $ . gritter . add ( { // (string | mandatory) the heading of the notification title : window . _ ( 'ep_email_notifications.titleGritterError' ) , // (string | mandatory) the text inside the notification text : window . _ ( 'ep_email_notifications.msgOptionsNotChecked' ) , // (string | optional) add a class name to the gritter msg class_name : "emailNotificationsSubscrOptionsMissing" } ) ; } else if ( email ) { $ ( '#' + formName ) . submit ( ) ; } return false ; }
Control options before submitting the form
Control options before submitting the form