Copy link to clipboard
Copied
Hi.
I need some help in making the right JavaScript for my Price Group checkboxes. I will try to explain.
First of all, my Price Group 1 checkbox is always checked (YES) and locked in normal setup.
What I want help with is when
And the other way around
You must not be able to check (YES) to a higher Price Group unless you also get the Price Groups below. And if you uncheck (OFF) a lower Price Group you also uncheck (OFF) any higher Price Groups.
I hope it make sence to someone who are able to help me setup the right JavaScript.
Thanks in advance!
/Jesper
Copy link to clipboard
Copied
One way would be to use a Mouse Up script for each of the check boxes. They would get the value of the check box that it's attached to using event.target.value and get the values of the other check boxes, and then use logic to determine what to do with the other check boxes. It will involve more than a few lines of code, so I'm not going to do it for you here, but if you post what you've tried, we can provide more guidance if needed.
Another option is to create a custom calculate script in a hidden text field. It can determine which field triggered the script using event.source and determine what to do with the other check boxes if one of them was the trigger. This may be a better since all of the code could be placed in a single routine.
Copy link to clipboard
Copied
Hi George.
Thanks for your reply. Unfortunately, I'm a rookie when it comes to making JavaScript. Therefore I don't have made anything yet, as I don't know where to start.
I have tried to search for similar questions in the community, but can't find anything.
/Jesper