Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Search Page - question

 
Sumithab Baskaran
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a search page with the following parameters.

Search by Name: (textbox)

Search by SSN: (textbox)

Search by Zipcode: (textbox)

The user enters info in the textboxes and hits the search button. It takes the user to the searchResults page that displays the list. This searchResults page has a "New Search" button. When the user hits this button, the search page is displayed, but with empty textboxes. What should I do to store the entered information and display it when they hit the "New Search" button?
for example, in the search page, if they enter Search by zipcode as "55535" and hit the search button. a list is displayed in the searchResults page. When they hit the "New Search" button, now it should go back to the search page and contain the zipcode "55535" in that textbox.

Any suggesstions?
 
Bimal Patel
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sessions? Or hidden fields? More elaborately, by session, you can store the search fields which can be retrieved anywhere till the session lives. Or, by other way, you can probably store the search criteria a in the search result page by hidden fields and then while submitting to the previous page again i.e. search page, try to retrive values came from the request parameter in the main search criteria page and then fill those textboxes with such values! By this, you can avoid session. But you need to take care that if there are no values of such parameters, fill the text boxes by "". I hope you are able to understand what I mean to explain!
 
Jason Liao
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am afraid "hidden fields" is better.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic