Client Script newValue not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:19 AM
The following client script on a service form, which is active, Global, not Inherited, of type OnChange, Table = correct table, and Field Name = correct field name and the form field currently has the following value "20%" shows the following in the alert ... regardless of what a user enters into the field, such as "30%", "15%", "5%", 10,15,30.
newValue: 20% Old: 20% (everytime).
Any ideas on what might be going on would be greatly appreciated.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading ) {
return;
}
alert ("newValue: " + newValue + " Old: " + oldValue); // Always displays the same value that is in the field?!
}
Thank you in advance.
- G
In fact if I change it to this:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading ) {
return;
}
alert ("newValue: " + newValue + " Old: " + oldValue); // Totally not working !!
var inVal = g_form.getValue('u_pdepttax');
alert ("inVal: " + inVal);
}
The second alert displays the original value and not the one I enter into the field on the form, as well.
Thus, second alert displays "20%" when 30 is entered into the field? Odd. Everything else on the form works as expected - FWIW.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:34 AM
what data type is the field in question?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:37 AM
works fine with a string.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:38 AM
Field type is string. No, it is not working as expected.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2019 10:42 AM
i have a field on my record, 'name', type string.
when i open the record value is 20%.
i change it to 30%.
the alert ("newValue: " + newValue + " Old: " + oldValue) displays the value as expected.
newValue: 30% Old: 20%