I have three pages of static html and the last page has submit button. I want to put all the data into database when i hit the button. This part I can do using servlets, but i want to know how to get data from the previous html page. It is a online form with three html pages.each html page leading to the other. If u have any idea of how to go about please help me.
The standard way to do this is to link the pages via a servlet, rather than just a raw hyperlink. For example: Page 1:
When the servlet receives a POST request it checks the value of the "action" parameter. If it is "Go To Page 2" then it saves the first page of information in a temporary place (in the current session for example), then displays the second page. If "action" is "Finish", it retrieves both the stored temporary data from page 1 and the parameters from page 2 and processes them together. I've used this technique for both sequential multi-page forms and more complex "tabbed" pages where the user can select them in any order.
Thanx for ur suggestion I am using anchors to navigate. I have to use them . Now can i place a hidden button which gets invoked without user's knowledge and which does the storing of temporarry data thru servlets. Any ideas of how to go about like how will my hidden button get focus automatically etc etc.
Joined: Jan 07, 1999
I'm puzzled as to why you "have to use" an anchor. Can you clarify this? Are there other important restrictions?
Joined: Feb 04, 2004
I tried ur code but gives me error saying object does'nt support this property or method. What is the problem? Thanx for ur reply.