This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Select the value from the Combo box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Select the value from the Combo box" Watch "Select the value from the Combo box" New topic
Author

Select the value from the Combo box

Ad Rajesh
Greenhorn

Joined: Apr 25, 2006
Posts: 21
hi, i am selecting a value in the drop down.with respect to the selected value i have to reload the page or refresh the content of the page.
HJw can i do that?
Please help.


SCJP 1.4
SCWCD 5.0
Soumik Basu
Ranch Hand

Joined: Oct 01, 2007
Posts: 40
use AJAX,Thats the best possible solution as you are trying to communicate between server and client without submitting or refreshing the page.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Do a serach for double combo or linked selects. There should be plenty of examples with postbacks or with Ajax.

Eric
Amit Sharma
Greenhorn

Joined: Oct 29, 2007
Posts: 4
Hi Rajesh,

Please do the following in the Select box html code call a javascript which takes the selected value from drop box and based on this Call the struts Action or what ever you are calling to refresh the Page.

eg

<select name="demo" onChange="refreshPage(this)">
<option value="1"> 1</option>
<option value="2"> 2</option>
</select>

Note this is just an idea that i am providing I dont have any live example to give you right now.

Regards
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60050
    
  65

Also, to avoid confusion, you should stop calling it a "combo box". A combo box is a type of UI control that is not available on the web. Call it a dropdown or a select.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Select the value from the Combo box
 
Similar Threads
jsp
How to Get Valueof SelectField
Enable isn't working in script
System.out.println in jsp
How to bind data to a textbox in servlet?