Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  <meta charset="utf-8">
  <title>JS Bin</title>
</head>
<body>
  <input type="text" id="fafsaNbrFam" name="fafsaNbrFam" value="6" class="hidden" >
<div id="submit">
  submit
  </div>
 
</body>
</html>
 
$("#submit").click(function(e) {                               
        var numEntries = 0;
        var fafsaNbr = 0;
        $("input[name^='name_']").each(function() {
          if (this.value) {
            numEntries++;
          }
        });
        // EVERYTHING ABOVE HERE WORKS
        fafsaNbr = $("input[name=fafsaNbrFam]").val();
        alert(fafsaNbr + "X");
        // WHERE THE 6 is I want to put the variable fafsaNbr, just hardcoded for now.
        if (6 > numEntries && !confirm("The number of members you listed in your household is less than the number you indicated on your FAFSA.  Please confirm or correct your household size. ")) {
          e.preventDefault();
        }
      });
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
mohamedriaspro
0viewers