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...
Anyways, here is my for loop:
<%for(Aj aj : ajList) {%>
Job Name: <%=jobDao.getById(aj.getJobId()).getTitle() %><br/>
Current Status: <%=statusDao.getById(aj.getStatusId()).getStatusName() %><br/>
<input id="notQualified[<%=aj.getStatusId()%>]" class="notQualified[<%=aj.getStatusId()%>]" name="notQualified[<%=aj.getJobId() %>]" value="Not Qualified" type="submit" />
<input id="qualified[<%=aj.getStatusId()%>]" class="qualified[<%=aj.getStatusId()%>]" name="qualified[<%=aj.getJobId() %>]" value="Make Qualified" type="submit" />
<input id="interview[<%=aj.getStatusId()%>]" class="interview[<%=aj.getStatusId()%>]" name="interview[<%=aj.getJobId() %>]" value="Interview" type="submit" />
<input id="hire[<%=aj.getStatusId()%>]" class="hire[<%=aj.getStatusId()%>]" name="hire[<%=aj.getJobId() %>]" value="Hire" type="submit" /><br/><br/>
<%}%>
And here is the jquery I've written thus far:
$(function() {
$('.notQualified[<%=1%>]').attr('disabled', 'disabled');
$('.interview[<%=1%>]').attr('disabled', 'disabled');
$('.hire[<%=1%>]').attr('disabled', 'disabled');
$('.qualified[<%=2%>]').attr('disabled', 'disabled');
$('.interview[<%=2%>]').attr('disabled', 'disabled');
$('.notQualified[<%=3%>]').attr('disabled', 'disabled');
$('.qualified[<%=3%>]').attr('disabled', 'disabled');
$('.interview[<%=3%>]').attr('disabled', 'disabled');
$('.hire[<%=3%>]').attr('disabled', 'disabled');
$('.qualified[<%=4%>]').attr('disabled', 'disabled');
$('.hire[<%=4%>]').attr('disabled', 'disabled');
});
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.