Skip to content

Commit

Permalink
Issue #3483: Handle disabled elements on AJAX and on form submit.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter committed Jun 19, 2024
1 parent 66fee22 commit 94772a2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
24 changes: 24 additions & 0 deletions var/httpd/htdocs/js/Core.AJAX.js
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,30 @@ Core.AJAX = (function (TargetNS) {
return;
}

// TODO MultiValue Think about a solution to transfer unchecked value
if ($(this).is(':checkbox, :radio')) {
if ($(this).is(':checked')) {
QueryString += encodeURIComponent(Name) + '=' + encodeURIComponent($(this).val() || 'on') + ";";
}
}
else if ($(this).is('select')) {
$.each($(this).find('option:selected'), function(){
QueryString += encodeURIComponent(Name) + '=' + encodeURIComponent($(this).val() || '') + ";";
});
}
else {
QueryString += encodeURIComponent(Name) + '=' + encodeURIComponent($(this).val() || '') + ";";
}
});
$Element.closest('form').find('.DynamicFieldText').each(function () {
var Name = $(this).attr('name') || '';

// only look at fields with name
// only add element to the string, if there is no key in the data hash with the same name
if (!Name.length || typeof Ignore[Name] !== 'undefined'){
return;
}

// TODO MultiValue Think about a solution to transfer unchecked value
if ($(this).is(':checkbox, :radio')) {
if ($(this).is(':checked')) {
Expand Down
4 changes: 4 additions & 0 deletions var/httpd/htdocs/js/Core.UI.InputFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ Core.UI.InputFields = (function (TargetNS) {
TargetNS.InitCustomerField( this );
});
}

$('form').on('submit', function() {
$('.DynamicFieldText').attr('disabled', false);
});
};


Expand Down

0 comments on commit 94772a2

Please sign in to comment.