- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 02:54 PM
I've created a form using a UI Page and would like some of the fields to dynamically change depending on what is entered in other fields. For example if a user fills out field A with $100,000 and field B with $25,000, is it possible for field C to dynamically change to $125,000 (A+B) without submitting or reloading the page? Would that be a client or processing script?
Thanks!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 12:42 PM
You do not need onChange client script declaration. Remove everything from the client script section and just copy this
function sum(){
$('H').value=parseFloat($('D').value)+parseFloat($('G').value);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:27 PM
Change the deduct_3() function to this
function deduct_3(){
var c = parseFloat($('deductions_adjustments_1').value) - parseFloat($('deductions_adjustments_2').value);
if (c<= 0) {
$('deductions_adjustments_3').value = 0;
}
else {
$('deductions_adjustments_3').value =c;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:42 PM
I actually tried that first, but ServiceNow doesn't like that <= character

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:45 PM
That is weird. Are you using this in client script section?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:46 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:47 PM
Use them in the client script section