File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Multipage HTML Forms Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Multipage HTML Forms" Watch "Multipage HTML Forms" New topic
Author

Multipage HTML Forms

Paul Doherty
Greenhorn

Joined: Jan 11, 2001
Posts: 11
Hi All,
I am currently trying to find a good solution of what I would describe as a number of different pages within a form. At the moment what I do is call a HTML page that is used for entering user details and then enter the details and press submit to invoke a servlet that updates a DB. However the form that the user is presented with on the screen is an "ugly, really long, top-to-bottom" stlye form. What I want to do is for the page to load once with a number of buttons on the bottom like next, back, submit, etc and for the user to see the first part of the form, then click next and see the next part, etc. I DONT want to make subsequent requests for additional pages in order to give the effect. The page must only load once. I have been looking into DHTML and Javascript...
Any help, ideas, solutions would be greatly appreciated.
Regards,
Paul.
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
What about using a frameset. In the navigation frame (the one that is always the same) you could put a bunch of hidden fields to store the values that the user enters. Then you could allow them to navigate through a bunch of pages in the other frame, entering data as they go. You could store their responses in the corresponding hidden field in the other frame. Then when you get to the last page, you could do your submit from the other frame.
But that solution would involve loading multiple pages. You said you don't want to do that, right? Hmmmmm...
Brian Nice
Ranch Hand

Joined: Nov 02, 2000
Posts: 195
Could you use layers on this, by hiding and unhiding layers? I'm not sure if that is a cross platform solution but I know that it is a relatively easy thing to do in Dreamweaver
Brian
gaurav chaudhary
Ranch Hand

Joined: Jun 24, 2002
Posts: 64
But will Netscape support layers?


gaurav
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60041
    
  65

ONLY Netscape will support layers, and the LAYER element is deprecated in modern version of Netscape.
To use "overlays" in modern browsers (IE5+, NN6+, Mozilla, Safari) you can use DIV elements with the display attribute set to block (for visible) and none (for hidden).
hth,
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
gaurav chaudhary
Ranch Hand

Joined: Jun 24, 2002
Posts: 64
Can I take all the layers of one html in one form?
Maulin Vasavada
Ranch Hand

Joined: Nov 04, 2001
Posts: 1871
i like theframe thing better to avoid layers etc DHTML issues across browsers...
regards
maulin
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
The layers solution is not hard at all. The only browser that may have trouble with it is Opera, but I am probably the only one here that uses that. If you give a basic layout of your form, I might be able to play with it tom. and show you how easy it is. I was thinking the look of a tab folder on top to show the different layers. You can go the frame way, but there is problems with frames too. Back button with frames, bookmarking, refresh button. etc.
Both ways has there flaws, but no one seemed to mention them.
Eric
Frank Carver
Sheriff

Joined: Jan 07, 1999
Posts: 6920
Just a warning to be careful with this technique, though. There are significant usability problems with multi-page web forms which don't occur in single-page forms.
The main issue is that a lot of users can't help assuming that each "page" has somehow been "saved" when they leave it by clicking, and are quite likely to hop off to another URL or close the browser without explicitly "saving" or "finishing" the whole form.


Read about me at frankcarver.me ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
gaurav chaudhary
Ranch Hand

Joined: Jun 24, 2002
Posts: 64
Hi Eric Pascarello ! Actually what I want to do is take three objects of html on one layer and three objects(text boxes) on other layer and provide one save button at the bottom which will be shown to the user irrespective of on which layer he is in...... and when he presses the save button then whole form gets submitted. I want to implement just that.....
thanks in advance
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I will work on it as soon as I get my computer back up and running,,,,I reformatted every thing an lets say Microsoft is not being friendly...
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
look at this:
http://www10.brinkster.com/a1ien51/help/DIVMENU.htm
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Multipage HTML Forms
 
Similar Threads
AI based search engine in JAVA
Submit Button in JSP Page Scrolls Frame!
HttpSession/HttpRequest and performance
Struts 1.2.9 +text areas.
How to set focus to top of page