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 Verfiy/ Preview form data before submitting. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Verfiy/ Preview form data before submitting." Watch "Verfiy/ Preview form data before submitting." New topic
Author

Verfiy/ Preview form data before submitting.

Karthik Muthukumaraswamy
Greenhorn

Joined: Oct 30, 2006
Posts: 12
Hello,
I want to implement a functionality where a user is shown all the form data he recently entered before he decides to submit/edit it.

Something like this:
enter data -> preview -> submit/edit

ps: I am using JSP and struts.
Thank you.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61092
    
  66

Anything that transpires prior to submission must be done with JavaScript.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joel Jorgensen
Greenhorn

Joined: Oct 13, 2006
Posts: 22
There are two ways that I can think of that you would be able to do this. The first way, as Bear mentioned, would be to use JavaScript to validate the form data and rearrange the page to provide a preview of what the user would be submitting. Put a "preview" button on the form and have it call a JavaScript function to do the validation/rearrangement, and then provide Submit and Edit buttons which will either submit the page or return it to it's previous (editable!) form, respectively.

The other way to do it would involve sending it to the server, Struts would do the validation (the details of which elude me as yet) and return either success (in the form of a preview JSP which takes the values from the form and displays them the way they'll be submitted) or failure (probably the original form, with the erroneous parts somehow highlighted for easy repair). The preview page would also provide a button for the user to confirm/submit the data, and a button for the user to edit the data, and each would be mapped to their appropriate Struts Actions (though if you want more details on how to do it that way, the proper place for it would probably be the Struts forum).


Go is to the fountain.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Verfiy/ Preview form data before submitting.