Checkbox Export Values and JavaScript
- November 8, 2023
- 2 replies
- 3169 views
Hello all, I've run into a JavaScript problem that I'm having trouble solving (and hopefully I can explain it properly).
I have a form that is calculating totals depending on which checkboxes are marked.
I've attached an image of an example of what I'm working on (it's not the actual form but a simplified version that I made in a spreadsheet).
I currently have the checkboxes set up to export a value so for example, if Checkbox A is marked, it exports a value of $50.
What I need help with is the Import Fee textbox. I need a script that takes the export value from each checkbox, and it triggers the Import Fee based on which checkbox is selected.
For example, if Checkbox A is marked, then the Import Fee will display $100. If no checkboxes are marked, the total needs to be $0.
Only one checkbox will be marked per form (but the form is not setup with radio buttons) so the import fees do not need to be added up.
I'm having trouble with getting the script to look for more than one export value from the checkboxes. I can make it work for one checkbox, but not multiple.
Any help is appreciated!
