aspose file tools
The moose likes JSP and the fly likes Unable to retain Dropn down values after submitting form Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Unable to retain Dropn down values after submitting form" Watch "Unable to retain Dropn down values after submitting form" New topic
Author

Unable to retain Dropn down values after submitting form

Diptee Bhakre
Greenhorn

Joined: Apr 06, 2010
Posts: 2
Hi All,

I am not able to retain drop down values after submitting form in my jsp.
My jsp is as follows.

<form name="branch" target="_top" action="" method="get">
<select name="searchDropDown" id="br">
<option value="Select Entity to search">Select Entity to search</option>

<option value="MN">main</option>
<option value="EX">examples</option>
<option value="TR">training</option>
<option value="IC">content</option>
<option value="EU">europe</option>
</select>
<input type="text" name="searchText" value="<%=searchText%>" />
<input type="submit" name="submit" value="submit" onClick="validate();"/>

I am able to retain my text box value. But unable to do so for dropdown "searchDropDown".

Thanks in advance.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Please UseCodeTags when posting code or configuration. Unformatted code and configuration is unnecessarily difficult to read.

What do you mean, "retain"? You have no code that would re-select any options; you use a value for the text. Options won't magically select themselves!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unable to retain Dropn down values after submitting form
 
Similar Threads
unable to access the values of dynamically newly added rows to table
Retain drop down values in JSP
File Upload
can anyone tell me how do we update the values in servlet?
Pre select a dropdown using cookie.