Two Laptop Bag*
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
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: 61310
    
  66

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]
 
GeeCON Prague 2014
 
subject: Select the value from the Combo box