fariba123
0
Newbie Poster
Recommended Answers
Jump to Postvar checkBox = document.getElementById(boxID);
checkBoxValue = checkBox.value;
Jump to PostOr if you are talking about a group of checkboxes with the same name you would do something like this:
page_html.php
<form method="post" action=""> <input type="checkbox" id="things[]" value="red"> Cat<br> <input type="checkbox" id="things[]" value="blue"> Mouse<br> <input type="checkbox" id="things[]" value="green"> Car<br> <input type="checkbox" id="things[]" value="yellow"> DaniWeb </form>
page_php.php
…
Jump to Post<form action='page.php' method='post'> <input type='checkbox' name='chk' value='value1'> ANY VALUE 1 <br> <input type='checkbox' name='chk' value='value2'> ANY VALUE 2 <br> <input type='checkbox' name='chk' value='value3'> ANY VALUE 3 <br> <input type='checkbox' name='chk' value='value4'> ANY VALUE 4 <br> <input type='submit' name='submit' value='Get Value'> </form>
page.php codes:
<?php …
All 9 Replies
Phaelax
52
Practically a Posting Shark
the_count
0
Newbie Poster
nickclarson
0
Newbie Poster
muhammadsajid
0
Newbie Poster
lyrico
23
Junior Poster in Training
cossay
7
Junior Poster
Kuldeep_singh
0
Newbie Poster
navmalik
0
Newbie Poster
bhagyashree.bhatt2
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.