add_file.js.html

About this file

This file contains a script that handle file form validation upon clicking the next buttons. If the user selects the event to add a file, the user is required to add a file. If file is not fully uploaded, the user cannot proceed to the next part of the form. Once the file form is validated, an array of files is created, with the matching privacy to each file.

Code Issues

  • For the first next button, at least 5 if statements are seen, but no else conditions. Recommend refactoring into different functions to make the event handler code easier to read and refactor to use else statements.

Code Check Report


                        

Documentation drawn from source code

  $(function () {
   next1.click(function (e) {
     var filenames = first.find(".secured-name").map(function () {
     var title = first.find(".title-field").map(function () {
     var privacy = first.find(".file-privacy:checked").map(function () {
      success: function (data) {
   next2.click(function () {
     success: function (data) {
      emailSummary.find('p').filter(function () {
   prev2.click(function () {
   prev3.click(function () {
   submit.click(function () {
   function getRandomString(length, chars) {

Source code