title: Using Jquery and for each loop (written in scriptlets)
body: <p>I am working on a project using the Spring MVC framework, and am currently stuck on figuring out how to disable submit buttons that have been produced from a for each loop (written in spriptlets). I know that scriptlets are considered bad practice, but the company I'm training at doesn't seem to care...</p>
  
  <p>Anyways, here is my for loop:</p>
  
  <pre><code>&lt;%for(Aj aj : ajList) {%&gt;
      Job Name: &lt;%=jobDao.getById(aj.getJobId()).getTitle() %&gt;&lt;br/&gt;
      Current Status: &lt;%=statusDao.getById(aj.getStatusId()).getStatusName() %&gt;&lt;br/&gt;
      &lt;input id="notQualified[&lt;%=aj.getStatusId()%&gt;]" class="notQualified[&lt;%=aj.getStatusId()%&gt;]" name="notQualified[&lt;%=aj.getJobId() %&gt;]" value="Not Qualified" type="submit" /&gt;
      &lt;input id="qualified[&lt;%=aj.getStatusId()%&gt;]" class="qualified[&lt;%=aj.getStatusId()%&gt;]" name="qualified[&lt;%=aj.getJobId() %&gt;]" value="Make Qualified" type="submit" /&gt;
      &lt;input id="interview[&lt;%=aj.getStatusId()%&gt;]" class="interview[&lt;%=aj.getStatusId()%&gt;]" name="interview[&lt;%=aj.getJobId() %&gt;]" value="Interview" type="submit" /&gt;
      &lt;input id="hire[&lt;%=aj.getStatusId()%&gt;]" class="hire[&lt;%=aj.getStatusId()%&gt;]" name="hire[&lt;%=aj.getJobId() %&gt;]" value="Hire" type="submit" /&gt;&lt;br/&gt;&lt;br/&gt;
  &lt;%}%&gt;
  </code></pre>
  
  <p>And here is the jquery I've written thus far:</p>
  
  <pre><code>$(function() {
      $('.notQualified[&lt;%=1%&gt;]').attr('disabled', 'disabled');
      $('.interview[&lt;%=1%&gt;]').attr('disabled', 'disabled');
      $('.hire[&lt;%=1%&gt;]').attr('disabled', 'disabled');
      $('.qualified[&lt;%=2%&gt;]').attr('disabled', 'disabled');
      $('.interview[&lt;%=2%&gt;]').attr('disabled', 'disabled');
      $('.notQualified[&lt;%=3%&gt;]').attr('disabled', 'disabled');
      $('.qualified[&lt;%=3%&gt;]').attr('disabled', 'disabled');
      $('.interview[&lt;%=3%&gt;]').attr('disabled', 'disabled');
      $('.hire[&lt;%=3%&gt;]').attr('disabled', 'disabled');
      $('.qualified[&lt;%=4%&gt;]').attr('disabled', 'disabled');
      $('.hire[&lt;%=4%&gt;]').attr('disabled', 'disabled');
  });
  </code></pre>
  
  <p>So, if it isn't clear, I am working with 4 different statuses. If the "aj" (a table in the database that connects users with jobs they've applied to and the status of the job for that user) being iterated corresponds to the 1st status, disable the "not qualified," "interview," and "hire" buttons. Etc. I would appreciate any help.</p>