Validation Plugin Not Working

Validation Plugin Not Working

I've been trying to get this working for hours and can't work out why it's not working - can anybody help?  Nothing happens at all, no validation or anything!

index.php:
  1. <?php
  2. include '../db/connect.php';
  3. include 'course_finder.php';
  4. ?>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <title>Module Matcher  |  Register</title>
  9. <meta name="viewport" content="width=400" />
  10. <link rel="stylesheet" href="../css/style.css" />
  11. <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
  12. <script type="text/javascript" src="../js/validate.js"></script>
  13. <script type="text/javascript" src="../js/js.js"></script>
  14. </head>
  15. <body>
  16. <section id="page">
  17. <header id="page_head">
  18. <a href="../">
  19. <div id="app_title">
  20. <img id="logo" src="../img/aru.gif"/>
  21. <h1>Module Matcher</h1>
  22. </div>
  23. </a>
  24. <h2>Register</h2>
  25. </header>
  26. <form id="register" method="post" action="adduser.php">
  27. <p class="star">* indicates required field</p>

  28. <h3>Account Information</h3>
  29. <label for="username">Username *</label>
  30. <p class="clarification">no spaces please</p>
  31. <input id="username" name="username">
  32. <label for="password">Password *</label>
  33. <input id="password" type="password" name="password">
  34. <label for="password_confirm">Confirm Password *</label>
  35. <input id="password_confirm" type="password" name="password_confirm">

  36. <label for="real_name">Real Name *</label>
  37. <input id="real_name" name="real_name">
  38. <label for="email">Email Address *</label>
  39. <p class="clarification">not displayed publicly by default</p>
  40. <input id="email" type="email" name="email">
  41. <h3>Course Information</h3>
  42. <label for="year">University Start Year *</label>
  43. <input id="year" type="number" value="2012" name="year">

  44. <script type="text/javascript">
  45. $(document).ready(function() {
  46. $('#loading').hide();
  47. $('#department').change(function(){
  48.  $('#loading').show();
  49.  $('#result_1').hide();
  50.      $.get("course_finder.php", {
  51. func: "course_get",
  52. department_var: $('#department').val()
  53.      }, function(response){
  54.        $('#result_1').fadeOut();
  55.        setTimeout("finishAjax('result_1', '"+escape(response)+"')", 400);
  56.      });
  57.     return false;
  58. });
  59. });

  60. function finishAjax(id, response) {
  61.  $('#loading').hide();
  62.  $('#'+id).html(unescape(response));
  63.  $('#'+id).fadeIn();
  64. }
  65. </script>
  66. <label for="department">Department</label>
  67. <select name="department" id="department">
  68.       <option value="" selected="selected" disabled="disabled">Select a Department</option>
  69.       <option value="Arts, Law and Social Sciences">Arts, Law and Social Sciences</option>
  70.       <option value="Health, Social Care and Education">Health, Social Care and Education</option>
  71.       <option value="Lord Ashcroft International Business School">Lord Ashcroft International Business School</option>
  72.       <option value="Science and Technology">Science and Technology</option>
  73.     </select> 
  74.     
  75.     <span id="loading" style="display: none;">
  76.     <p>Loading courses...</p>
  77.     </span>

  78.     <span id="result_1" style="display: none;"></span>
  79. <h3>Contact Information</h3>
  80. <label for="facebook">Facebook Username</label>
  81. <input id="facebook" name="facebook">
  82. <label for="twitter">Twitter Username</label>
  83. <input id="twitter" name="twitter">
  84. <input id="submit" type="submit">
  85. </form>
  86. </section>
  87. </body>
  88. </html>


js.js:
  1. $.validator.setDefaults({
  2. submitHandler: function() { alert("submitted!"); }
  3. });

  4. $().ready(function() {
  5. $("#register").validate({

  6. rules: {
  7. username: {
  8. required: true,
  9. minlength: 2
  10. },

  11. password: {
  12. required: true,
  13. minlength: 5
  14. },

  15. password_confirm: {
  16. required: true,
  17. minlength: 5,
  18. equalTo: "#password"
  19. },

  20. real_name: {
  21. required: true
  22. },

  23. email: {
  24. required: true,
  25. email: true
  26. },

  27. year: {
  28. required: true,
  29. digits: true
  30. }
  31. },

  32. messages: {
  33. username: {
  34. required: "Please enter a username",
  35. minlength: "Your username must consist of at least 2 characters"
  36. },

  37. password: {
  38. required: "Please enter a password",
  39. minlength: "You password must consist of at least 5 characters"
  40. },

  41. password_confirm: {
  42. required: "Please confirm your password",
  43. equalTo: "Passwords do not match"
  44. },

  45. real_name: {
  46. required: "Please enter your real name"
  47. },

  48. email {
  49. required: "Please enter a valid email address"
  50. },

  51. year {
  52. required: "Please enter a valid year"
  53. }
  54. }
  55. });
  56. });

Thanks so much!!