How to call a function from an OnLoad Client Script from an Onsubmit client script?
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2023 11:03 AM
I need to be able to update the value of a field in an OnLoad Client Script. I am calling the function that updates the field from an OnSubmit Client Script but I am not sure that I am calling the function correctly. I leave the code that I am using:
Catalog Client Script OnSubmit:
function onSubmit() {
var totalCost = 10;
updateGrandTotal(totalCost);
}Catalog Client Script OnLoad:
function updateGrandTotal(totalCost) {
g_form.setValue('grand_total', totalCost);
}
function onLoad() {
}