Need Help with jQuery Validator

Need Help with jQuery Validator

I'm trying to get the Validator Plug-in to work on my form. I've read the documentation and tried several different things and nothing is stopping my form from being submitted. I don't know if I'm doing something wrong. I tried debugging in firebug, but it didn't return any errors.

Here's my form & the code I'm using, I just want a very basic require & don't need anything fancy (yet).


  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <head>
  4. <title> Add New Event</title>
  5. <link rel="stylesheet" type="text/css" href="eventform_style.css" />
  6. <script type="text/javascript" src="datetimepicker_css.js"></script>
  7. <script type="text/javascript" src="jquery.validate.js"></script>
  8. <script type="text/javascript" src="jquery.js"></script> 

  9. <script type="text/javascript">
  10. jQuery.validator.setDefaults({
  11. debug: true,
  12. success: "valid"
  13. });;
  14. </script>

  15.   <script>
  16.   $(document).ready(function(){
  17.     $("#eventForm").validate({
  18.   rules: {
  19.     eventType: "required"
  20.     eventTitle: "required"
  21.     eventAddress: "required"
  22.     eventCity: "required"
  23.     eventState: "required"
  24.     eventStartTime: "required"
  25.     eventEndTime: "required"  
  26.     eventAccess: "required"   
  27.   }
  28. });
  29.   });
  30.   </script>   
  31. </head>

  32. <html>
  33. <body>

  34. <form method="post" id="eventForm" action="db_input.php">
  35. <br/>
  36. <fieldset>
  37. <legend><h5>Add New Event</h5></legend>
  38. <br/>

  39. <table>
  40. <h6>All <img src="images/notice-note.png" border="0" width="10" height="10"> Fields Are Required</h6>
  41. <tr>
  42. <td><label for="eventType">Event Type:</label></td>
  43. <td><select id="eventType" name="eventType">
  44.    <option value=""></option>
  45. <option value="Business">Business</option>
  46.                                  <option value="Concert">Concert</option>
  47.                                 <option value="Dating">Dating</option>
  48. <option value="Dining">Dining</option>
  49. <option value="Fitness">Fitness</option>
  50. <option value="Jobs">Jobs</option>
  51.                                 <option value="Nightlife">Nightlife</option>
  52. <option value="Politics">Politics</option>
  53. <option value="Sports">Sports</option>
  54. <option value="Travel">Travel</p></option>
  55. <option value="Tv and Film">Tv and Film</option>
  56. </select>
  57. <img src="images/notice-note.png" border="0" width="10" height="10">
  58. </td>
  59. </tr>
  60. <tr>
  61. <td><label for="eventTitle">Event Title:</label></td>
  62. <td><input id="eventTitle" type="text" name="eventTitle" size="25">
  63. <img src="images/notice-note.png" border="0" width="10" height="10">
  64. </td>
  65. </tr>
  66. <tr>
  67. <td><label for="eventLocation">Event Location:</label></td>
  68. <td><input id="eventLocation" type="text" name="eventLocation" size="25"></td>
  69. <td align="left"><p class="form">(ie. Central Park)</p></td>
  70. </tr>
  71. <tr>
  72. <td><label for="eventAddress">Address:</label></td>
  73. <td><input id="eventAddress" type="text" name="eventAddress" size="25">
  74. <img src="images/notice-note.png" border="0" width="10" height="10">
  75. </td>
  76. </tr>
  77. <tr>
  78. <td><label for="eventCity">City:</label></td> 
  79. <td><input id="eventCity" type="text" name="eventCity" size="20">
  80. <img src="images/notice-note.png" border="0" width="10" height="10">
  81. </td>
  82. </tr>
  83. <tr>
  84. <td><label for="eventState">State:</label></td> 
  85. <td><input id="eventState" type="text" name="eventState" size="2">
  86. <img src="images/notice-note.png" border="0" width="10" height="10">
  87. </td>
  88. </tr>
  89. <tr>
  90. <td><label for="eventStartTime">Start Date:</label></td>
  91. <td>
  92. <input id="eventStartTime" type="text" name="eventStartTime" size="25">
  93. <a href="javascript: NewCssCal('eventStartTime','mmmddyyyy','dropdown',true,12)">
  94. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a>
  95. <img src="images/notice-note.png" border="0" width="10" height="10">
  96. </td>
  97. </tr>
  98. <tr>
  99. <td><label for="eventEndTime">End Date:</label></td>
  100. <td><input id="eventEndTime" type="text" name="eventEndTime" size="25">
  101. <a href="javascript: NewCssCal('eventEndTime','mmmddyyyy','dropdown',true,12)">
  102. <img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a Date"></a>
  103. <img src="images/notice-note.png" border="0" width="10" height="10">
  104. </td>
  105. </tr>
  106. <tr>
  107. <td><label for="eventAccess">Choose Members with Access:</label></td>
  108. <td><select id="eventAccess" name="eventAccess">
  109. <option value="All Members">Public to All Members</option>
  110. <option value="All Friends">Public to All Friends</option>
  111. <option value="Select Friends">Only Public to These Friends:</option>
  112. <option value="Private">This Event is Private</option>
  113. </select>
  114. <img src="images/notice-note.png" border="0" width="10" height="10">
  115. </td>
  116. <td align="left"><a class="tryitbtn" href="gallery/choosefriends.php" onClick="myPopup2()" name="ChooseFriends" value="ChooseFriends">Choose Friends</a></td>
  117. </tr>
  118. <tr>
  119. <td><label for="GroupCategory">Choose Groups with Access:</label></td> 
  120. <td><select id="GroupCategory" name="GroupCategory">
  121.    <option value=""></option>
  122. <option value="Art">Art</option>
  123. <option value="Artists">Artists</option>
  124. <option value="Business">Business</option>
  125. <option value="Business Networking">Business Networking</option>
  126. <option value="Dating">Dating</option>
  127. <option value="Dining">Dining</option>
  128. <option value="Fitness">Fitness</option>
  129. <option value="Jobs">Jobs</option>
  130. <option value="Music">Music</option>
  131. <option value="Musicians">Musicians</option>
  132. <option value="Nightlife">Nightlife</option>
  133. <option value="Pets">Pets</option>
  134. <option value="Politics">Politics</option>
  135. <option value="Sports">Sports</option>
  136. <option value="Travel">Travel</option>
  137. <option value="Tv and Film">Tv and Film</option>
  138. <option value="Wine">Wine</option>
  139. </select></td>
  140. </tr>
  141. <tr>
  142. <td><br/><br/>
  143. <input type="submit" name="submit" value="SUBMIT">
  144. <input type="reset" name="reset" value="RESET">
  145. </td>
  146. </tr>
  147. </table>
  148. </fieldset>


  149. </body>
  150. </html>