JSP Checkboxes
Hi evryone.. got a problem here...I have added the code below here... I am creating combo boxes based on the
getNoOfTreatment(),then the combo boxes are created
dynamically...
there should b options frm A to Z...
if A is chosen in one the option A shldnt appear in
other combo boxes..so on..
i.e: if a set of 3(value of NoOfTreatment) combo boxes are created with values A-Z.
if the user selects A in the first set, then the second combo box should display all the alphabets except A which has been selected in the previous set.
Can someone please tel me how to implement this.
<%
Collection initDef =(ArrayList) request.getAttribute("initDefinition");
Iterator it = initDef.iterator();
int treatment;
try
{
System.out.println("definition Size IS "+initDef.size());
DefinitionDVO design = (DefinitionDVO) it.next();
treatment =design.getNoOfTreatment();
System.out.println("Treatment is"+treatment);
String allTreatment[]={"A","B","C","D","E","F","G","H","I","J","K","L", "M","N","O","P","Q","R","S","T","U","V","W","X","Y ","Z"};
String[] tempTreatment=new String[25];
String selectName="code";
for(int i=0; i<treatment; i++)
{
selectName="code"+Integer.toString(i); %>
<tr> <TD class="note2" colspan="1" style="color:#000000">
<select name="selectName">
<%for(int j=0;j<26;j++)
{%>
<option name="selectName"> <%=allTreatment[j]%> </option>
<%}%>
</TD>
<TD class="note" colspan="1" NOWRAP="true"><input type=text>
</td>
<TD class="note2" colspan="1" NOWRAP="true"><input type=text>
</td>
<TD class="note1" colspan="1" NOWRAP="true"><textarea></textarea>
</td>
</tr>
<%
}
}
catch(Exception e)
{
System.out.println("Exception in Definition "+e);
}
%>
</table>
|