Jquery Form Validation Checkboxes

Jquery Form Validation Checkboxes

Hi, My first post and new with jquery. I'm trying to implement the validation plugin. I've managed to make the code working in a separate file but once I implement it to my main file it just doesn't work. 

This is how i generate my checkbox.

  1. <form id="formID" action="go.php" method="post" >
  2. <?php $result = mysql_query("SELECT * FROM tbl_category order by name ");
  3. $i=1;
  4. while($row = mysql_fetch_array($result)){
  5. echo '<input type="checkbox" class="validate[minCheckbox[1]] checkbox" name="categories[]"  value="'.$row['category_id'].'" id="'.$row['name'].'">'.
  6. '<label for="'.$row['name'].'" class="fil_lab" ><span></span>'.$row['name']. '</label>';
  7. if($i%5==0)
  8. {
  9. $i = 0;
  10. echo '<br><br>';
  11. }
  12. $i++;}
  13. ?>
  14. <input class="submit" type="submit" value="Validate & Send the form!"/>
  15. </form>
and this is my links:
  1. <script src="js/jquery.js" type="text/javascript"></script>
  2. <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
  3. <script src="js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"></script>
  4. <script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
  5. <script>
  6. jQuery(document).ready(function(){
  7. // binds form submission and fields to the validation engine
  8. jQuery("#formID").validationEngine();
  9. });
  10. </script>
The above code is working but once I implemented it on my main file nothing happens. and my form just submits.

This is my head area:


  1. <script type='text/javascript'>

  2. var map;
  3. var marker;
  4. function initialize() {
  5.  var negros = new google.maps.LatLng(10.4167, 123.0000);
  6.  var mapOptions = {
  7.    zoom: 8,
  8.    center: negros,
  9.    mapTypeId: 'roadmap'
  10.  };
  11.  map =  new google.maps.Map(document.getElementById("map"), mapOptions);
  12.   google.maps.event.addListener(map,'click', function(event) {
  13. document.getElementById("latbox").value = event.latLng.lat();
  14. document.getElementById("lngbox").value = event.latLng.lng();
  15. addMarker(event.latLng);
  16.  });
  17. }
  18. function addMarker(location) {
  19.    // ... snip ...
  20.    if (!marker) {
  21.        // Create the marker if it doesn't exist
  22.        marker = new google.maps.Marker({
  23.        position: location,
  24.        map: map,
  25. draggable:true,
  26. animation: google.maps.Animation.DROP
  27.        });
  28.    }
  29.    // Otherwise, simply update its location on the map.
  30.    else { marker.setOptions({ position  : location,
  31.                    animation : google.maps.Animation.BOUNCE}); }
  32. }

  33. </script>
  34. <!-- form validation-->

  35. <script src="js/jquery.js" type="text/javascript"></script>
  36. <link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/>
  37. <script src="js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8   </script>
  38. <script src="js/jquery.validationEngine.js" type="text/javascript" charset="utf-8"></script>
  39. <script>
  40. jQuery(document).ready(function(){
  41. // binds form submission and fields to the validation engine
  42. jQuery("#formID").validationEngine();
  43. });
  44. </script>
  45. <!--END -->
  46. <style type="text/css">
  47. input[type="checkbox"] {
  48.    display:none;
  49. }
  50. input[type="checkbox"] + label span {
  51.    display:inline-block;
  52.    width:19px;
  53.    height:19px;
  54.    margin:-1px 4px 0 0;
  55.    vertical-align:middle;
  56.    background:url(check_radio_sheet.png) left top no-repeat;
  57.    cursor:pointer;
  58. }
  59. input[type="checkbox"]:checked + label span {
  60.    background:url(check_radio_sheet.png) -19px top no-repeat;
  61. }
  62. </style>
  63.     

  64. </head>
and how I generate checkboxes.

  1. <?php $result = mysql_query("SELECT * FROM tbl_category order by name ");
  2. $i=1;
  3. while($row = mysql_fetch_array($result)){
  4. echo '<input type="checkbox" class="validate[minCheckbox[1]] checkbox" name="categories[]" 
  5. value="'.$row['category_id'].'" id="'.$row['name'].'">
  6. '.'<label for="'.$row['name'].'" class="fil_lab" ><span></span>'.$row['name'].'</label>';
  7. if($i%5==0)
  8. {
  9. $i = 0;
  10. echo '<br><br>';
  11. }
  12. $i++;}
  13. ?>
Please help. I've been trying to solve this the whole day.