princehyderabad
asked on
CheckBox Mapping to DropDown
hi experts,
I have a form:
while (rs.next())
{
...
<input type=checkbox name="<%=r%>" value="<%=sss%>">
<option value="<%=ALevel%>"><%=ANa me%></opti on>
}
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 ("CheckBox Name");
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
I have a form:
while (rs.next())
{
...
<input type=checkbox name="<%=r%>" value="<%=sss%>">
<option value="<%=ALevel%>"><%=ANa
}
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
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
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Hi,
How big is your resultset? Is it dynamic size or you know how big it is?
regards,
fargo
How big is your resultset? Is it dynamic size or you know how big it is?
regards,
fargo
ASKER
Quite a big !!
It shows 4 diff. Zone(South, North, East, West) and each zone has alteast 10-12 checkbox (ie) area names.
It shows 4 diff. Zone(South, North, East, West) and each zone has alteast 10-12 checkbox (ie) area names.
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
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
ASKER
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
thx,
PH
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
go thru it..try to implement it and let us know if you face any problems.
fargo
ASKER
https://www.experts-exchange.com/questions/21775732/Passing-value-from-popup-window.html
This above link at bottom line explains how to get such values, excepts that its uses child-win to get in parent window.