function fixCommas(frm, field) {
var sf = nuSubformObject(frm);
for (var i = 0; i < sf.rows.length; i++) {
$('#' + frm + nuPad3(i) + field).attr('onchange', '').on('blur', function (event) {
$(this).val($(this).val().replace(',', '.'));
nuChange(event);
});
}
}
if (nuFormType() == 'edit') {
fixCommas('rsf_prevision', 'pre_facturacion');
fixCommas('rsf_prevision', 'pre_margen');
}
When I type for example 40,50 onblur event calls fixComma() and it converts this number to € 40,40. For some reason, automatically it calls again fixCommas() changing again € 40,40 by € 40.40, but this value with € inside is not valid and this is why the field turns blanks.
Although not so pretty, if I change the filed type to number instead nuNumber keeping the call to fixCommas() it works fine.
I do not know if it's worthwhile to continue investing time knowing that this works and waiting for the fix..
What's your opinion?
I'm stealing you a lot of time and I do not think it's bine.
function fixCommas(frm, field) {
var sf = nuSubformObject(frm);
for (var i = 0; i < sf.rows.length; i++) {
$('#' + frm + nuPad3(i) + field).attr('onchange', '').off('blur').on('blur', function (event) {
$(this).val($(this).val().replace('1', '2'));
nuChange(event);
});
}
}
My opinion: This should be fixed by the the nuBuilder Staff. My fixCommas() function is only intended as a workaround.