• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Unable to retain Dropn down values after submitting form

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
What's gotten into you? Could it be this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic