- 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:52 PM
Hey Abhinay,
Wow that worked, but can you explain to me why sum() can be in the HTML section, but deduct_3() has to be moved down to the Client Script section?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:55 PM
Both can be in either HTML or client script section. I believe you are missing the the script closing tag in the HTML </script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:56 PM
Well, the </script> tag is below my screenshot, unless each function needs to be contained within their own <script></script>, but I don't think that's true.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2016 02:58 PM
Yeah you can enclose all the functions inside a single script tag. But I usually prefer to write them in the client script section.