CheckBox Mapping to DropDown

hi experts,

I have a form:
while (rs.next())
{
...
<input type=checkbox name="<%=r%>" value="<%=sss%>">
   <option value="<%=ALevel%>"><%=AName%></option>

}

Output:

[ ] CheckBox1     [dropdown: PM, CM, SM]
[ ] CheckBox2     [dropdown: PM, CM, SM]
[ ] CheckBox3     [dropdown: PM, CM, SM]


If user check the checbox and select from dropdown item. i wanna pass that relation or mapping to Processing page. (ie) Passing Which checkbox and its corresponding dropdown value.

Without dropdown I used my Processing code as:
..
String[] selected1 = request.getParameterValues("CheckBoxName");
if (selected1 != null && selected1.length != 0)
              {
                for (int i = 0; i < selected1.length; i++)
             {
                       //Update Query
                      ???? NOW HERE HOW TO GET DROPDOWN VALUE ALSO ????
             }          
              }



tHX,
PH
princehyderabadAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

fargoCommented:
Hi,

It's not that straight forward. If you are using struts, you can make use of indexed properties.

here is one example
http://www.developer.com/java/ejb/article.php/2233591

regards,
fargo
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
princehyderabadAuthor Commented:
thanks fargo, but I dont think its that complex. It has nothing to do with struts though I'm using struts action class for that form.

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21775732.html
This above link at bottom line explains how to get such values, excepts that its uses child-win to get in parent window.
0
fargoCommented:
Hi,

How big is your resultset? Is it dynamic size or you know how big it is?

regards,
fargo
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

princehyderabadAuthor Commented:
Quite a big !!

It shows 4 diff. Zone(South, North, East, West) and each zone has alteast 10-12 checkbox (ie) area names.
0
fargoCommented:
Hi,

as i already said, if the number of input fields are finite (like 40 in your case) you can still give some fixed name and use them for the code. But it is not a good practise and i will still give you an opinion for indexed properties.

fargo
0
princehyderabadAuthor Commented:
I think its better for go with index. Can U help me figure how to write java code to accept those indexed values. I dont know much abt index. I can do getparameter and getparametervalues stuff....sample code will help.

thx,
PH
0
fargoCommented:
the link i gave you at my first post is the best i have.
go thru it..try to implement it and let us know if you face any problems.

fargo
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JSP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.