diff --git a/admin/new_ticket.php b/admin/new_ticket.php index 2dab4e2f..790e69cf 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -186,10 +186,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- - placeholder=""> + placeholder="" + onkeyup="disableIfEmpty('email-input','notify-email')">
@@ -942,7 +943,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
-
+


diff --git a/js/modsForHesk-javascript.js b/js/modsForHesk-javascript.js index cc98d8e9..9fb5597d 100644 --- a/js/modsForHesk-javascript.js +++ b/js/modsForHesk-javascript.js @@ -68,4 +68,15 @@ function toggleContainers(showIds, hideIds) { }); } +function disableIfEmpty(sourceId, destinationId) { + if ($('#' + sourceId).val().length > 0) { + $('#' + destinationId).attr('disabled', false); + } else { + if ($('#' + destinationId).is(':checkbox')) { + $('#' + destinationId).attr('checked', false); + } + $('#' + destinationId).attr('disabled', true); + } +} + jQuery(document).ready(loadJquery);