I have 4 checkboxes.

What i am trying suppose if red is checked then my query execute
"Select * from tbl where color='red'";
similarly for black
"Select * from tbl where color='black'";

Need suggestions.I have knowledge of PHP,Mysql but not of java script,ajax

<title>Checkbox Event Handler</title> 
<style type="text/css"> 
#myGroup {visibility:hidden} 
<script type="text/javascript"> 
function toggle(chkbox, group) { 
    var visSetting = (chkbox.checked) ? "visible" : "hidden"; 
    document.getElementById(group).style.visibility = visSetting; 
<form  action = ""  method = "post"> 
<input type="checkbox" name="monitor" onclick="toggle(this, 'myGroup')" />Monitor
<span id="myGroup">
      /* Database connectivity and query execution has to write here
  <input type="radio" />ok 

Its great and its working properly for me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.