// Please see documentation at https://learn.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.

// Normalize decimal commas to dots before form submission so both 42.22 and 42,22 are accepted.
document.addEventListener('submit', function (e) {
    e.target.querySelectorAll('input[type="text"], input:not([type])').forEach(function (input) {
        if (/^-?\d+(,\d+)?$/.test(input.value.trim())) {
            input.value = input.value.replace(',', '.');
        }
    });
});
