You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,7 @@ This uses PHP, but there is also a [pure HTML version](https://npatullo.w3.uvm.e
11
11
-`Select None`
12
12
13
13
`Select None` works to **deselect radio buttons**
14
+
**This is for mutually exclusive choices, but the entire is question optional & you want*****`no response`*****to be valid**
14
15
The other 2 functions *can* be used on radio buttons, but **aren't effective** since radio buttons are mutually exclusive & results in the last radio button being selected
15
16
It doesn't break anything, just doesn't work as intended
16
17
@@ -37,14 +38,14 @@ This says:
37
38
3. Only `invert()` the checkboxes in the group `chkBoxes[]`
38
39
- The only difference for `selectAll()` and `selectNone()` is the name of the function to call
39
40
- Buttons are only linked to checkbox groups by the parameter they send to the function so can technically appear anywhere on the page, but should be close to their linked HTML elements for ease of use
40
-
-
41
+
-
41
42
- jQuery functions set the **property** of an input element using `item.prop("checked", true);` because `item.attr('checked','checked');` doesn't work
42
43
`attr` updates the HTML & you can see it happen in realtime using *Inspect Element*, but the actual page doesn't change
43
44
-`selectAll` simply adds `element.prop("checked", true);` to every element in a group regardless of its current state
44
45
This guarantees all items in a group are checked & it doesn't hurt to set the property to `true` if it's already `true`
45
46
-`selectNone` is the opposite & simply sets the `property` to `false`
46
47
- The `invert` function checks if an input is checked (true/false) & sets the new property to the opposite of its previous state by negating `true` or `false`
47
-
-
48
+
-
48
49
-**USE `selectNone` ON RADIO BUTTONS TO "DE-SELECT" THE RADIO BUTTON ALTOGETHER, BUT `invert` & `selectNone` WON'T WORK FOR RADIO BUTTONS***
49
50
50
51
###PHP Version Specific
@@ -68,4 +69,4 @@ I cobbled together my own `invert()` function based on various sources because n
68
69
-[CSS-Tricks: A jQuery hasAttr() Equivalent](https://css-tricks.com/snippets/jquery/make-an-jquery-hasattr/) testing if an an element has an attribute
69
70
-[Stack Overflow: jQuery checkbox event handling](http://stackoverflow.com/a/29367737) helped when finding how to call functions
70
71
-
71
-
-[HTML Multi checkbox set - the correct way to group checkboxes | wasted potential](http://www.wastedpotential.com/html-multi-checkbox-set-the-correct-way-to-group-checkboxes/)
72
+
-[HTML Multi checkbox set - the correct way to group checkboxes | wasted potential](http://www.wastedpotential.com/html-multi-checkbox-set-the-correct-way-to-group-checkboxes/)
0 commit comments