view-request-contact.js

About this file

The function in this file assigns the data-parsley-required and validation message to required fields. Character limits are also assigned to fields: first name, last name, email, and message. Character counts are displayed for the fields, except for email. The contact form is checked for valid responses in the form.

Code Issues

  • The format of this file looks very similar to app/static/js/request/contact.js. Both use the same span HTML element and have attributes being set multiple times for DOM elements. Recommend creating a separating JS file that this file and app/static/js/request/contact.js can use, such as having a function that takes in a DOM element and an object of attributes that are paired with their values.

Code Check Report



                        

Documentation drawn from source code

$(document).ready(function () {
  $("#contact-form").parsley().on("form:validated", function () {
   $(".parsley-required").each(function () {
   $(".parsley-type").each(function () {
  firstName.keyup(function() {
  lastName.keyup(function() {
  message.keyup(function() {

Source code