Welcome to the nuBuilder Forums!
Register and log in to access exclusive forums and content available only to registered users.
Register and log in to access exclusive forums and content available only to registered users.
Decimal comma & nuDebug() Entries
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
I tried this but doesn't works...
var x = document.getElementsByClassName("input_nuNumber nuNumber nuEdit");
var i;
for (i = 0; i < x.length; i++) {
$fieldname = x.id;
$($fieldname).attr('onchange','').on('blur', function(event) {
$(this).val($('#nuNumber').val().replace(',','.'));
nuChange(event);
});
}
var x = document.getElementsByClassName("input_nuNumber nuNumber nuEdit");
var i;
for (i = 0; i < x.length; i++) {
$fieldname = x.id;
$($fieldname).attr('onchange','').on('blur', function(event) {
$(this).val($('#nuNumber').val().replace(',','.'));
nuChange(event);
});
}
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
Re: Decimal comma & nuDebug() Entries
It's easier with the nuSubformObject() function:
Example:
Code: Select all
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);
});
}
Code: Select all
fixCommas('yoursubformid','youfieldid');
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
I'm trying to understand...
This code is to enter in JS code of the Form?
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);
});
}
and where I have to put the call to this function?
This code is to enter in JS code of the Form?
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);
});
}
and where I have to put the call to this function?
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
What is this function??
nuPad3(i)
I can't find it in the documentation...
nuPad3(i)
I can't find it in the documentation...
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
Ok
Forget my last post...
I have put this code in JS Code of the Form
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);
});
}
And this one in the 'onchange' event of the subform field
fixCommas('yoursubformid','youfieldid');
It executes the function fixCommas getting the right values for frm, field and sf variables, but it doesn't change the field value replacing the '.' by ','
I apologize for the inconvenience toms.
Forget my last post...
I have put this code in JS Code of the Form
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);
});
}
And this one in the 'onchange' event of the subform field
fixCommas('yoursubformid','youfieldid');
It executes the function fixCommas getting the right values for frm, field and sf variables, but it doesn't change the field value replacing the '.' by ','
I apologize for the inconvenience toms.
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
Hello!!
Again forget everything I said.
I had mis indicated the name of the subform.
Now it works correctly.
I'm very grateful toms!
Again forget everything I said.
I had mis indicated the name of the subform.
Now it works correctly.
I'm very grateful toms!
-
- Posts: 785
- Joined: Sun Oct 14, 2018 11:25 am
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
I have made these changes on subform field... including two events, onchange & onblur
is it ok?
is it ok?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 49
- Joined: Thu May 03, 2018 12:08 pm
Re: Decimal comma & nuDebug() Entries
Excuse me..
These are the changes I've made.. but I think this is not the best place to put it, isn't it?
The function fixCommas() is in the Form JS Code.
These are the changes I've made.. but I think this is not the best place to put it, isn't it?
The function fixCommas() is in the Form JS Code.
You do not have the required permissions to view the files attached to this post.