mirror of
https://github.com/unraid/webgui.git
synced 2026-01-01 06:59:56 -06:00
Feedback form: enable/disable SUBMIT button automatically
This commit is contained in:
@@ -226,12 +226,12 @@ $(function() {
|
||||
if ($('#submit-button').length == 0) $('button.confirm').before('<input type="button" id="submit-button" value="<?=_('Submit')?>" disabled>');
|
||||
|
||||
$('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 = "<?=_('Contact Email Address')?>";
|
||||
var option = " (<?=_('optional')?>)";
|
||||
$('#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(){
|
||||
|
||||
Reference in New Issue
Block a user