Wrox Programmer Forums
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 8th, 2005, 04:41 AM
Registered User
 
Join Date: Feb 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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>







Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Checkboxes arholly Excel VBA 1 August 7th, 2008 11:32 AM
Loop through checkboxes Godko Visual Studio 2005 1 April 9th, 2006 11:32 PM
Please Help. mr_newreq.jsp:78: jsp:useBean can't f batken JSP Basics 0 February 22nd, 2006 09:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.