Hi,
I have 4 checkboxes.
red
black
brown
white

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

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

Its great and its working properly for me.

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.