• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Verfiy/ Preview form data before submitting.

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Sheriff
Posts: 67747
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anything that transpires prior to submission must be done with JavaScript.
 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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).
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic