title: event.PreventDefault() is not working on click , and no alerts ? where did I go wrong?
body: <p>Ok , I am finding something wrong with my Jquery and PHP &amp; HTML code , everything used to work , but now event.Preventdefault isn't working , and my Jquery can't loop through the input fields to get the data of the forms ?  where did I possibly go wrong ? below is my code</p>
  
  <pre><code>&lt;?php
          header ("Cache-Control: no-cache, must-revalidate");    // HTTP/1.1
          header ("Expires: Sat 26 Jul 1997 05:00:00 GMT");       // Date in the past
          require_once ("../_includes/functions.php");
          ?&gt;
          &lt;link rel="stylesheet" title="Style CSS" href="../_reports/report_assets/cwcalendar.css" type="text/css" media="all" /&gt;
          &lt;script src="../_js/jquery-1.6.2.min.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
          &lt;script src="../_js/timer.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt;
          &lt;script type="text/javascript" src="../_reports/report_assets/calendar.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
          $(document).ready(function(){
              $('#select').click(function(event){ 
                  $(':checkbox').prop("checked", true);
                  event.preventDefault();
              });
              $('#deselect').click(function(event){ 
                  $(':checkbox').prop("checked", false);
                  event.preventDefault();
              });
  
              $('#add').click(function() {
                  var field = '&lt;input class="project_fields" type="text" size ="30" name = field_settings[] /&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
                  var checkbox = '&lt;input class ="checkbox" type ="checkbox" name ="check_field[]" /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
                  var delete_link = '&lt;a class ="delete_link" style="text-decoration:none;" href="#"&gt; Delete field &lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&lt;br /&gt;';
                  var input = field + checkbox + delete_link;
                  $('#input_fields').append(input);
              });
  
  
              $('#project_fields_submit').click(function(event) {
                  event.PreventDefault();
                  var array_fields = new Array();
                  $('.checkbox').each(function() {
                      if($(this) .is(':checked')) {
                          array_fields.push('1');
                          alert('checked!!!');
                      }
                      else {
  
                          array_fields.push('0');
                          alert('not checked !!!')
                      }
  
                  });
                  $('#checkboxes').val(array_fields);
              });
  
              $('#edit_fields_submit').click(function(event) {
                  event.PreventDefault(); // this here doesn't work
                  var edit_fields = new Array();
                  $('.edit_check').each(function() {
                      if($(this) .is(':checked')) {
                          alert('checked !!!'); // doesn't alert anything after filling out the fields , though it used to
                          edit_fields.push('1');
                      }
                      else {
  
                          edit_fields.push('0');
                          alert('not checked !!!');
                      }
  
                  });
                  $('#edit_checkboxes').val(edit_fields);
  
              });
              var nextRowID = 0;
              $('#add_edit').click(function() {
                  var id = ++nextRowID;
                  var new_field = '&lt;input class ="class'+id+'"  type="text" size ="40" name = edit_field_value[] value =""&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;';
                  var new_checkbox = '&lt;input class ="class'+id+'"  type ="checkbox" name ="check_field[]" &gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;';
                  var delete_edit = '&lt;a id ="'+id+'" class ="new_delete_edit" style="text-decoration:none;" href="#" &gt; Delete field &lt;/a&gt;&lt;br&gt;&lt;br&gt;';
                  var new_input = new_field + new_checkbox; 
                  $('#new_input_fields').append(new_input);
                  $('#new_input_fields').append(delete_edit);
              });
  
  
              $('a.delete_edit').click(function(event) {
                  event.preventDefault();
                  var ID = $(this).attr('id');
                  var delete_field_id = 'edit_field'+ID;
                  var field_data = $('#'+ delete_field_id).val(); 
                  var project_id =  $('#edit_project_id').val();
                  var string = {field : field_data, pid : project_id };
                  $.ajax({
                      type: "POST",
                      url: "_ajax/delete_field.php",
                      data: string,
                      success: function(data){
                          $('#'+ID).remove();
                          $('#'+delete_field_id).remove();
                          $('#new_check'+ID).remove();
                      }
                  });
  
  
              });
  
  
              $('.new_delete_edit').live('click', function(event) {
                  event.preventDefault();
                  var id = $(this).attr('id');
                  $('.class'+id).hide();
                  $('#'+id).hide();
              });
  
          });
  &lt;/script&gt;
  
  
  
  
  &lt;?php
  
  if (isset($_GET['pid']) &amp;&amp; isset($_GET['user_id'])) {
  
      $id = $_GET['user_id']; 
      $pid = $_GET['pid']; 
      $show_id = $_GET['show_id']; 
  "       
  
          $query_settings ="SELECT project_settings FROM projects WHERE project_id ='$pid'";
          $result_settings = mysql_query($query_settings);
          $row_settings = mysql_fetch_array($result_settings,MYSQL_ASSOC);
          if($row_settings['project_settings'] == NULL) {
              echo "&lt;h2&gt; Project Settings &lt;/h2&gt;";
              echo "&lt;br&gt;&lt;br&gt;";
              echo " &lt;b&gt; Add fields &lt;/b&gt;";
              echo "&amp;nbsp;&amp;nbsp;";
              echo "&lt;img id ='add' src='_assets/add.png' /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;";
              echo '&lt;form action ="" method="post"&gt;';
              echo'&lt;input type="hidden" name="pid" value="'.$pid.'"&gt;';
              echo "&lt;input id ='checkboxes' type ='hidden' name ='checkboxes' value ='' &gt;";
              echo "&lt;div id='input_fields'&gt; &lt;/div&gt;";
              echo '&lt;input id ="project_fields_submit"  type ="submit" name ="project_fields_submit" class="button" value ="Save Settings" /&gt;&lt;br&gt;&lt;br&gt;';
              echo '&lt;/form&gt;';
              echo "&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;p&gt;&lt;/p&gt;";
          }
          else  {
              echo "&lt;h2&gt; This Project Settings &lt;/h2&gt;";
              echo "&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;";
              echo "&lt;b&gt; Add fields&lt;/b&gt;&amp;nbsp;&amp;nbsp;&lt;img id ='add_edit' src='_assets/add.png' /&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;";
              $fields_data = unserialize($row_settings['project_settings']); 
              $i = 0;
              echo '&lt;form action ="" method="post"&gt;';
              echo'&lt;input id ="edit_project_id" type="hidden" name="edit_project_id" value="'.$pid.'"&gt;';
              echo "&lt;div id='new_input_fields'&gt; &lt;/div&gt;";
              echo "&lt;input id ='edit_checkboxes' type ='hidden' name ='edit_checkbox' value ='' &gt;";
              foreach ($fields_data as $key =&gt; $value) {
                  if($value =="1") {
                      echo "&lt;input id ='edit_field".$i."' class ='edit_data' type ='text' size ='40' name = edit_field_value[] value ='".$key."' /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
                      echo "&lt;input id ='new_check".$i."' class ='edit_check' type='checkbox' name ='edit_checkboxes' checked /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
                      echo "&lt;a id ='".$i."' class ='delete_edit' style='text-decoration:none;' href='#'&gt; Delete field &lt;/a&gt;&lt;br&gt;&lt;br&gt;";
  
                  } else {
  
                      echo "&lt;input id ='edit_field".$i."' class ='edit_data' type ='text' size='40' name = edit_field_value[] value ='".$key."' /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
                      echo "&lt;input id ='new_check".$i."' class ='edit_check' type='checkbox' name ='edit_checkboxes' /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;";
                      echo "&lt;a id ='".$i."' class ='delete_edit' style='text-decoration:none;' href='#'&gt; Delete field &lt;/a&gt;&lt;br&gt;&lt;br&gt;";
                  }
                  $i++;
              }
              echo '&lt;input id ="edit_fields_submit"  type ="submit" name ="edit_fields_submit" class="button" value ="Save Settings" /&gt;&lt;br&gt;&lt;br&gt;';
              echo '&lt;/form&gt;'; 
          }
          echo '&lt;/div&gt;';
          echo '&lt;div id="project-setting-results"&gt;&lt;/div&gt;&lt;div class="clear"&gt;&lt;/div&gt;';
          echo '&lt;/div&gt;&lt;!-- end fragment-6 --&gt;';
      }
  
      ?&gt;
  </code></pre>