Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- //Each checkbox (targeted by its ID) is placed into an appropriately named variable
- var product1 = document.getElementById("input_1_1001");
- var product2 = document.getElementById("input_1_1002");
- var product3 = document.getElementById("input_1_1003");
- var allProducts = document.getElementById("input_1_1004");
- /* The following function is called by the onClick event in the "All Products Discounted" input tag.
- It can be interpreted as follows: If the "All Products Discounted" box is checked,
- the Product 1, Product 2 and Product 3 boxes become unchecked. ("0" is equivalent to "false") */
- function uncheckOthers() {
- if (allProducts.checked) {
- product1.checked = 0;
- product2.checked = 0;
- product3.checked = 0;
- }
- }
- /* The following function is called by the onClick event in the input tag of each of the first three checkboxes.
- It can be interpreted as follows: If Product 1 or Product 2 or Product 3 is checked, "All Products Discounted" becomes unchecked. */
- function uncheckDiscount() {
- if (product1.checked || product2.checked || product3.checked) {
- allProducts.checked = 0;
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment