I’m using GCE latest version with CI4 framework and when I try to apply some mask to input fields - mainly to float/decimal(10,2) fields - those values are changed (and masks are removed) when submitting! An example from customers table (tried with other mask library and a library of my own, none worked).
My main concern is that the value is changing on submit (see attached video).
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-mask-plugin@1.14.16/dist/jquery.mask.min.js"></script>
<script>
$(document).ready(function() {
const setupMasks = async () => {
await new Promise(resolve => setTimeout(resolve, 300));
$('#gc-form-creditLimit').mask("#.##0,00", {
reverse: true,
selectOnFocus: true
});
};
window.addEventListener('gcrud.form.edit-load', setupMasks);
});
</script>
What is happening here? Why the value is changing? Are there any validation taking place in the GCE library here? How can I apply proper monetary formating (with symbols) to all decimal(10,2) fields in the add and edit modal forms?
TIA.