How to get elements of option menu in same jsp

I have two option menu in one.jsp

<html:select property="pts_projectResource.empId" styleClass="midList" styleId="availableOptions" size="5" multiple="true" >

<html:optionsCollection property="pts_projectResource.empIDList"

value="value" label="label"/>

</html:select>

<html:select property="pts_projectResource.empId" styleClass="midList" styleId="availableOptions" size="5" multiple="true" >

</html:select>

here we r getting value from bean(pts_projectResource)

it will display like, sending jsp page code by view source:-

<select name="pts_projectResource.empId" multiple="multiple" size="5" class="midList" id="availableOptions"><option value="0001">Sashi Reddi</option>

<option value="0002">GKP Reddi</option>

<option value="0005">Syed Mustafa G</option>

<option value="0008">Radhika S</option>

<option value="0047">Ravi A</option>

<option value="0188">Ramachandra Murthy BS</option>

<option value="0207">Prabhu Das</option>

<option value="0223">Kameshwar Rao N</option>

<option value="0245">Shashidhar Rao L</option>

<option value="0267">Ravindra P</option>

<option value="0269">Drishti Tyagi</option>

<option value="0281">Ashwin Nagavelli</option>

<option value="040017">Sreedhar Khandavilli</option>

<option value="040062">Praveen Kumar P</option>

<option value="050076">swarna latha</option>

<option value="050215">Mritunjay Kumar</option>

<option value="050349">dhanunjay bacha </option>

<option value="050397">Prasadu Varikallu</option>

<option value="050459">Govardhan</option>

<option value="050478">Mri</option></select>

Now will select one element from first option menu and will click button it will apear in another option menu, suppose we have three selected element in second option menu,

now i want to catch the all three elements

from the second option menu.................i hope, i cleare the question

[2300 byte] By [vic.guptaa] at [2007-11-15]
# 1

I didn't really understand what you meant here. I'm guessing you want to move the values from one combo box to another when the user selects and clicks a button, right?

Then you want to use JavaScript ( for the client side, without submitting the page ). I guess AJAX could also help you out but I really don't know since I've never worked with it and have no idea of it's capabilities.

nogoodatcodinga at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 2
Hi nogoodatcoding,i m getting data from one combo box to another, now i want to catch all elements of second combo in same jsp, how can i...?Please help me out,Thanks in advance
vic.guptaa at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 3

> i m getting data from one combo box to another

So you already have the values in the required combo box then? OK.

> now i want to catch all elements of second combo in same jsp

When page is submitted ( the action attribute of the form is set to the same page right? ) then you can use Request.getParameterValues() which will return a String array with all the values that were selected in the second combo box ( yes, they have to be selected to be fetched )

nogoodatcodinga at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 4
Thanks nogoodat coding
vic.guptaa at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 5
You're welcome :)
nogoodatcodinga at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 6
How to get elements of option menu in same jsp
vic.guptaa at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...
# 7

<?xml version="1.0" encoding="ISO-8859-1" ?>

- <rss version="2.0" xmlns:jf="http://www.jivesoftware.com/xmlns/jiveforums/rss">

- <channel>

<title>Jive Forums RSS Feed</title>

<link>http://forum.java.sun.com</link>

<description>Most recent forum messages</description>

<language>en</language>

<generator>Jive Forums Enterprise 4.2.4 (www.jivesoftware.com)</generator>

<pubDate>Wed, 20 Jun 2007 05:52:58 -0700</pubDate>

- <item>

<title>Re: How to get elements of option menu in same jsp</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9728348&tstart=0#9728348</link>

- <description>

- <![CDATA[ How to get elements of option menu in same jsp

]]>

</description>

<jf:creationDate>Wed, 20 Jun 2007 05:22:20 -0700</jf:creationDate>

<jf:modificationDate>Wed, 20 Jun 2007 05:22:20 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>0</jf:replyCount>

</item>

- <item>

<title>Re: How to get elements of option menu in same jsp</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9706005&tstart=0#9706005</link>

- <description>

- <![CDATA[ Thanks nogoodat coding

]]>

</description>

<jf:creationDate>Fri, 08 Jun 2007 00:40:07 -0700</jf:creationDate>

<jf:modificationDate>Fri, 08 Jun 2007 00:40:07 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>1</jf:replyCount>

</item>

- <item>

<title>Re: How to get elements of option menu in same jsp</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9705898&tstart=0#9705898</link>

- <description>

- <![CDATA[ Hi nogoodatcoding,>

i m getting data from one combo box to another, now i want to catch all elements of second combo in same jsp, how can

]]>

</description>

<jf:creationDate>Thu, 07 Jun 2007 23:39:57 -0700</jf:creationDate>

<jf:modificationDate>Thu, 07 Jun 2007 23:39:57 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>3</jf:replyCount>

</item>

- <item>

<title>How to get elements of option menu in same jsp</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9705799&tstart=0#9705799</link>

- <description>

- <![CDATA[ I have two option menu in one.jsp>

<html:select property="pts_projectResource.empId" styleClass="midList" styleId="availableOptions"

]]>

</description>

<jf:creationDate>Thu, 07 Jun 2007 22:12:32 -0700</jf:creationDate>

<jf:modificationDate>Thu, 07 Jun 2007 22:12:32 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>6</jf:replyCount>

</item>

- <item>

<title>How to get elements of option menu in same jsp, with struts</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9703876&tstart=0#9703876</link>

- <description>

- <![CDATA[ See i have two option menu in one.jsp>

<html:select property="pts_projectResource.empId" styleClass="midList" styleId="availableOptions"

]]>

</description>

<jf:creationDate>Thu, 07 Jun 2007 02:07:07 -0700</jf:creationDate>

<jf:modificationDate>Thu, 07 Jun 2007 02:07:07 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>0</jf:replyCount>

</item>

- <item>

<title>Re: Problem</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9693204&tstart=0#9693204</link>

- <description>

- <![CDATA[ Also i m giving code which i used,>

<script>

var selectedList;

var availableList;

function

]]>

</description>

<jf:creationDate>Thu, 31 May 2007 22:26:47 -0700</jf:creationDate>

<jf:modificationDate>Thu, 31 May 2007 22:26:47 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>0</jf:replyCount>

</item>

- <item>

<title>Problem</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9693199&tstart=0#9693199</link>

- <description>

- <![CDATA[ HI,>

I have java script code that i m using in my jsp its working fine,

but when i m using same javascript code and calling same jsp by

]]>

</description>

<jf:creationDate>Thu, 31 May 2007 22:21:04 -0700</jf:creationDate>

<jf:modificationDate>Thu, 31 May 2007 22:21:04 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>2</jf:replyCount>

</item>

- <item>

<title>Re: JavaScript Method by which we can find out same name textfield data</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9668726&tstart=0#9668726</link>

- <description>

- <![CDATA[ Hi,>

Thanks a lot,

Code is working.What abot Nogoodatcoding...........?its good

]]>

</description>

<jf:creationDate>Wed, 16 May 2007 22:15:59 -0700</jf:creationDate>

<jf:modificationDate>Wed, 16 May 2007 22:15:59 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>0</jf:replyCount>

</item>

- <item>

<title>JavaScript Method by which we can find out same name textfield data</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9667008&tstart=0#9667008</link>

- <description>

- <![CDATA[ Hi,>

I m using three text box in jsp with same name,

i want to use javascript to show message box in that it will display all value of text

]]>

</description>

<jf:creationDate>Wed, 16 May 2007 03:07:06 -0700</jf:creationDate>

<jf:modificationDate>Wed, 16 May 2007 03:07:06 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>3</jf:replyCount>

</item>

- <item>

<title>Re: A simple question to ask about java array</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9582748&tstart=0#9582748</link>

- <description>

- <![CDATA[ Try with the following...................>

import java.util.*;

import java.io.*;

import java.lang.*;

public class

]]>

</description>

<jf:creationDate>Thu, 29 Mar 2007 04:40:49 -0700</jf:creationDate>

<jf:modificationDate>Thu, 29 Mar 2007 04:40:49 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>2</jf:replyCount>

</item>

- <item>

<title>Re: Please Help me out to do this task</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9580417&tstart=0#9580417</link>

- <description>

- <![CDATA[ thanks for reply, i m trying this...........

]]>

</description>

<jf:creationDate>Wed, 28 Mar 2007 04:57:28 -0700</jf:creationDate>

<jf:modificationDate>Wed, 28 Mar 2007 04:57:28 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>0</jf:replyCount>

</item>

- <item>

<title>Please Help me out to do this task</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9580346&tstart=0#9580346</link>

- <description>

- <![CDATA[ how will read contents of a text file " Hello.txt " and write same contents in reverse order in another file" Helllo2.txt "

]]>

</description>

<jf:creationDate>Wed, 28 Mar 2007 04:27:00 -0700</jf:creationDate>

<jf:modificationDate>Wed, 28 Mar 2007 04:27:00 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>2</jf:replyCount>

</item>

- <item>

<title>Please help to do this task</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9580136&tstart=0#9580136</link>

- <description>

- <![CDATA[ how will read contents of a text file, " Hello.txt "and write same contents in reverse order in another file " Hello2.txt "

]]>

</description>

<jf:creationDate>Wed, 28 Mar 2007 02:54:34 -0700</jf:creationDate>

<jf:modificationDate>Wed, 28 Mar 2007 02:54:34 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>1</jf:replyCount>

</item>

- <item>

<title>plz help me out to do this task</title>

<link>http://forum.java.sun.com/thread.jspa?messageID=9580123&tstart=0#9580123</link>

- <description>

- <![CDATA[ how will read contents of a text file like "Hello.txt" and write same contents in reverse order in another file"Hello2.txt"

]]>

</description>

<jf:creationDate>Wed, 28 Mar 2007 02:47:19 -0700</jf:creationDate>

<jf:modificationDate>Wed, 28 Mar 2007 02:47:19 -0700</jf:modificationDate>

<jf:author>vic.gupta</jf:author>

<jf:replyCount>1</jf:replyCount>

</item>

</channel>

</rss>

vic.guptaa at 2007-7-12 > top of java,Enterprise & Remote Computing,Web Tier APIs...