Solved

Retrieve value from <select> and pass to another <select>

Posted on 2006-06-21
1
202 Views
Last Modified: 2011-09-20
I would like to populate subsequent <select> tags based on user selections
<td>
<select id="cat" name="cat">
 <option value=""></option>
 <% for (int i=0;i<allcat.size();i++)
    {
      ecodes p = (ecode)allcat.get{i); %>
     <option value="<%=p.getcat()%><%=p.getcat()%></option>
    }
%>
</td>

<td>
<select id="area" name="area">
 <option value=""></option>
 <% for (int i=0;i<allcat.size();i++)
    { ArrayList allarea = cs.selectArea(SELECTED value from "cat");
    ...

?? I would like to pass the selected value from "cat". Can I do this? ??
     
    }
%>
</td>
Thanks,


0
Comment
Question by:franco32
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 3

Accepted Solution

by:
runa_paathak earned 125 total points
ID: 16957295
No you cannot. This part of your code

 <% for (int i=0;i<allcat.size();i++)
    { ArrayList allarea = cs.selectArea(SELECTED value from "cat");

is JSP code on the server-side. And selection from the first select will happen on the client-side when the user selects it. This will be available to the server only when the user submits the form.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Invest in your employees with these five simple steps to improve employee engagement and retention.
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question