jquery serizlize probilem with checkboxes
I am developing a simple search and select using php and jquery but after generating the results

I couldn't get the serialized values from checkbox please help me to figure out the problemindex.html
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Untitled Document</title>
- <script src="js/jquery-1.3.2.min.js"></script>
- <script src="js/controller.js"></script>
- </head>
- <body>
- <form>
- <input name="searchbox" type="text" id="searchbox" />
- <a class="button" id="submitbutton" href="#"><span id="buttontext">Search</span></a>
- </form>
- <div id="resultsContainer"></div>
- <tt id="rec"></tt>
- </body>
- </html>
control.js
- $(document).ready(function() {
- $("#submitbutton").click(function(){
- if($("#searchbox").attr('value')!=""){
- getResults();
- }
- });
- function getResults()
- {
- $.get("search.php",{stext: $("#searchbox").val(), type: "results"}, function(data){
- $("#resultsContainer").html(data);
- $("#resultsContainer").show("blind");
- });
- }
- $("form").submit(function () { return false; });
-
- function showValues() {
- var str = $("form").serialize();
- $("#rec").text(str);
- }
- $(":checkbox, :radio").click(showValues);
- $("select").change(showValues);
- });
php search
- <?php
- $objConn=new Control();
- $type='';
- $search = '';
- if(isset($_GET['stext']))
- {
- $search = $_GET['stext'];
- $type= $_GET['type'];
- }
- else
- {
- $search = "";
- }
- if($type == "results")
- {
- $result=$objConn->get_search($search);
- $idx='';
- while($array= mysql_fetch_array($result))
- {
- $idx=$array['id'];
- echo "<input type='checkbox' name='checkbox' value='0' id='$idx'/>";
- echo $idx."<br>";
- }
- }