Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to get check box values in an array
    primarykey
    data
    text
    <p>how to make array from values checked from multiple check box and send it to another file using Ajax . Also how can the checked value be removed from array when uncheck is performed on any previously checked box. Please help to do this using javascript. Below is whole form function arranged.Also i am able to send values for date,moth and year but not able to do same for selected time.</p> <pre><code>&lt;script&gt; function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); } else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) { document.getElementById("containerG").innerHTML=xmlhttp.responseText; } var date=document.getElementById("fdate).value; var month=document.getElementById("fmonth").value; var year=document.getElementById("fyear").value; var year=document.getElementById("time").value; var url ="selectedGraph.php?currentdate="+date"&amp;currentmonth"+month"&amp;currentyear="+year"&amp;currenttime="+selectedtime; alert("url"); } xmlhttp.open("GET",url,true); xmlhttp.send(); } &lt;/script&gt; </code></pre> <p>Below is check box function-:</p> <pre><code>&lt;?php function drop() { ?&gt; &lt;div style="border:2px solid #ccc; width:130px; height: 100px; overflow-y: scroll;"&gt; &lt;input type="checkbox" name="multiple[]" value="01"&gt;1-2 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="02"&gt;2-3 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="03"&gt;3-4 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="04"&gt;4-5 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="05"&gt;5-6 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="06"&gt;6-7 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="07"&gt;7-8 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="08"&gt;8-9 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="09"&gt;9-10 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="10"&gt;10-11 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="11"&gt;11-12 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="12"&gt;12-13 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="13"&gt;13-14 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="14"&gt;14-15 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="15"&gt;15-16 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="16"&gt;16-17 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="17"&gt;17-18 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="18"&gt;18-19 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="19"&gt;19-20 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="20"&gt;20-21 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="21"&gt;21-22 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="22"&gt;22-23 Hours&lt;/input&gt;&lt;br&gt; &lt;input type="checkbox" name="multiple[]" value="23"&gt;23-24 Hours&lt;/input&gt; &lt;/div&gt; &lt;?php }?&gt; &lt;?php echo "From: "; date_dropdown('from'); month_dropdown('from'); year_dropdown('from'); drop();?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload