From 1cf264bdd6fb5434e8a72c2e2e05bbe4e648d35e Mon Sep 17 00:00:00 2001 From: bergware Date: Sat, 3 Feb 2024 18:39:38 +0100 Subject: [PATCH] Feedback form: enable/disable SUBMIT button automatically --- emhttp/plugins/dynamix/scripts/feedback | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emhttp/plugins/dynamix/scripts/feedback b/emhttp/plugins/dynamix/scripts/feedback index e6cd0349e..da023a8da 100755 --- a/emhttp/plugins/dynamix/scripts/feedback +++ b/emhttp/plugins/dynamix/scripts/feedback @@ -226,12 +226,12 @@ $(function() { if ($('#submit-button').length == 0) $('button.confirm').before(''); $('input[name=mode]').click(function(){ - var label = $('input[name=mode]:checked').val(); - var required = (label == 'troubleshoot'); + var panel = $('input[name=mode]:checked').val(); + var required = (panel == 'troubleshoot'); var email = ""; var option = " ()"; - $('#submit-button').prop('disabled',$('#'+label)!=''); $('input#email').prop('placeholder',email+(required?'':option)).prop('required',required); + $('#submit-button').prop('disabled',validInput($('#'+panel+'_panel textarea').val(),panel) || !validEmail($('input#email'))); }); $('textarea').on('input change',function(){