Skip to content

Commit

Permalink
radio buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
SleekPanther committed Dec 1, 2016
1 parent b13cb87 commit 9b95369
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

Uses jQuery & JavaScript to select the opposite of any checkboxes that are currently selected

No CSS just to make things easier to understand
Possible improvements could be styling the buttons

###Tutorial Sources
I cobbled together my own `invert()` function based on various sources. All of which I found to not meet my standards or were too complex

Expand Down
9 changes: 8 additions & 1 deletion php.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function invert(nameToInvert){
?>

<form method="post" action='php.php'>
<p>Checkboxes</p>
<input type='checkbox' name='chkBoxes[]' value='1'>
<input type='checkbox' name='chkBoxes[]' value='2'>
<input type='checkbox' name='chkBoxes[]' value='3'>
Expand All @@ -68,7 +69,13 @@ function invert(nameToInvert){
<input type="button" name="btnAll" onclick="selectAll('chkBoxes[]')" value="All">
<input type="button" name="btnNone" onclick="selectNone('chkBoxes[]')" value="None">
<input type="button" name="btnInvert" onclick="invert('chkBoxes[]')" value="Invert">



<p>Radio Buttons</p>
<input type='radio' name='radRadios' value='1'>
<input type='radio' name='radRadios' value='2'>
<input type="button" name="btnNone" onclick="selectNone('radRadios')" value="None">

<br>
<input type="submit" value='Submit' name='btnSubmit'>
</form>
Expand Down

0 comments on commit 9b95369

Please sign in to comment.