wood burning stoves
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
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

Select the value from the Combo box

Ad Rajesh

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
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

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

Amit Sharma

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.


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

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

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63858

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] [About Bear] [Books by Bear]
wood burning stoves
subject: Select the value from the Combo box
It's not a secret anymore!