Guest User

Untitled

a guest
Apr 25th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. <form id = "form">
  2. <div>
  3. <label for = "firstName">First Name</label>
  4. <input type = "text" id = "firstName" placeholder = "Type First Name Here"
  5. name = "firstName" required autofocus >
  6. <br><br>
  7. <label for = "lastName">Last Name</label>
  8. <input type = "text" id = "lastName" name = "lastName">
  9. </div>
  10. <br>
  11. <div>
  12. <label for = "phone">Phone Number</label>
  13. <input type = "tel" id = "phone">
  14. </div>
  15.  
  16. <br>
  17.  
  18. <div> <p>
  19. <label>Email</label>
  20. <input type = "email" id = "email">
  21.  
  22. Password
  23. <input type = "password" id = "pass">
  24. </p>
  25. </div>
  26.  
  27. <br>
  28. <div> Which level of skill do you believe fits you (or your child) best?
  29. </div>
  30. Beginner<input type = "radio" value = "Beginner" name = "level">
  31. Intermediate<input type = "radio" value = "Intermediate" name = "level">
  32. Advanced<input type = "radio" value = "Advanced" name = "level">
  33. <div id = "level"></div>
  34. <br>
  35. <br>
  36.  
  37. <label for = "age-spinner">Student Age</label>
  38. <input id = "age-spinner" value = "5">
  39.  
  40. <br>
  41. <br>
  42. <div>Which days are you most available for a weekly piano lesson?</div>
  43.  
  44. <input type = "checkbox" value = "Monday" id = "monday" name = "days">Monday
  45. <input type = "checkbox" value = "Tuesday" id = "tuesday" name =
  46. "days">Tuesday
  47. <input type = "checkbox" value = "Wednesday" id = "wednesday" name =
  48. "days">Wednesday
  49. <input type = "checkbox" value = "Thursday" id = "thursday" name =
  50. "days">Thursday
  51. <input type = "checkbox" value = "Friday" id = "friday" name = "days">Friday
  52. <input type = "checkbox" value = "Saturday" id = "saturday" name =
  53. "days">Saturday
  54. <br>
  55. <br>
  56. <div>Best starting date? </div>
  57. <input type = "text" id = "startDate">
  58. </form>
  59. <br><br>
  60.  
  61. <input type = "submit" id = "submit">
  62. <button type= "button" id = "reset">Reset</button>
  63.  
  64. $( "input[type='submit']" ).button();
  65.  
  66. $.validator.setDefaults({
  67. submitHandler: function(){
  68.  
  69.  
  70. var firstName = $("#firstName").val();
  71. var lastName =$("#lastName").val();
  72. var phone = $("#phone").val();
  73. var email = $("#email").val();
  74. var pass = $("#pass").val();
  75. var age = $("#age-spinner").val();
  76. var level = $("input[name='level']:checked").val();
  77. var startDate = $("#startDate").datepicker({ dateFormat: 'dd,MM,yyyy' }).val();
  78. var days = " ";
  79.  
  80. //function to fill in data inputted from days
  81. $("input[name='days']:checked").each(function(){
  82. days += $(this).val() + ", "
  83. });
  84.  
  85. $("#output").append("<br><br>Name: " + firstName + " " + lastName)
  86. .append("<br>Phone #: " + phone)
  87. .append("<br>Email: " + email)
  88. .append("<br>Password: " + pass)
  89. .append("<br>Student Age: " + age)
  90. .append("<br>Student Level: " + level)
  91. .append("<br>Proposed Start Date: " + startDate)
  92. .append("<br>Available Days: " + days);
  93.  
  94. alert("Passed validation and submitted.");
  95. }//end submitHandler
  96. });
  97.  
  98. $("#form").validate();
Add Comment
Please, Sign In to add comment