Thanks to some help from mrichmon, I now have a Withdrawal form that does a query for CRNs for a student for the current term. The form returns the CRNs and also some drop down grade boxes and date input text boxes for the instructor to submit Withdrawal Information for each CRN that is returned. When a student withdrawals from the school, they are removed from all classes.
I then needed to kind of duplicate the withdrawal form for dropping (1) or more classes (but not all classes), and I have done it by using dynamically created checkboxes that are associated with each CRN that is returned from the query and then appending the same grade drop down boxes and date input boxes to each CRN that is returned. The instructor can then get all the CRNs that are for the student, and then just select the CRN that they are dropping. They could submit (1) CRN or multiple CRNs, but we don't want them to be able to check all the CRNs.
My problem is that I don't know how to limit the instructor from being able to check all the checkboxes, because if they do that they really need to be submitting the withdrawal form instead of the drop form.
Does anyone know how I might go about doing this? My checkboxes are created dynamically from the query, and on my processing page, I want to be able to loop through the CRNs that are processed and allow the instructor to be able to select each CRN checkbox that they need to select. If the instructor tries to submit all the CRNs, I think I want a pop-up window or an error message to display saying that they can't submit all CRNs from the drop class form, they must use the withdrawal form.
This may not be the best way to handle this, and I'm open to another suggestion. The main thing is that we need to have seperate forms because we ask for different information in each circumstance.
Thanks in advance for any help that you can offer.
Here is the code for the drop form:
<cfset CrnList = ValueList(get_classes.crn)
>
<CFOUTPUT query="get_classes">
<tr>
<td><div align="center"><input type="Checkbox" name="class#currentrow#" value="#get_classes.crn#" <cfif ListFind(CrnList, get_classes.crn)>unchecked
</cfif>>#g
et_classes
.class#</d
iv></td>
<td><div align="center">
<select name="grd#currentrow#" id="grd">
<option value="A">A</option>
<option value="B">B</option>
<option value="C">C</option>
<option value="D">D</option>
<option value="F">F</option>
<option value="W" selected>W</option>
<option value="WF">WF</option>
<option value="WP">WP</option>
</select>
</div></td>
<td><div align="center">
<select name="wegrd#currentrow#" id="wegrd">
<option value="1" selected>1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
</select>
</div></td>
<td><div align="center"><CF_DCCOM controlNumber="#currentrow
#" component="calendarControl
" dateFormat="dd-%b-%y" showTime="no" startdate="#DateFormat(now
(),"DD-MMM
-YYYY")#" name="ldoa#currentrow#"></
CF_DCCOM><
/div></td>
<td><div align="center"><input type="text" name="reason#currentrow#" id="reason"></div></td>
</tr>
</cfoutput>
<input type= "hidden" name="counter" value="<cfoutput>#get_clas
ses.record
count#</cf
output>">
</table>
Here is the code for processing the dropped CRNs:
<cfloop index="i" from="1" to="#form.counter#">
<CFOUTPUT>
<tr>
<td>#Form['class' & i]#</td>
<td>#FORM['GRD' & i]#</td>
<td>#FORM['WEGRD' & i]#</td>
<td>#FORM['ldoa' & i]#</td>
<td>#FORM['reason' & i]#</td>
</tr>
</CFOUTPUT></cfloop>