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

forms values lost

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a form and submit it
when validation fails it comes back with a
error meesage but the form values are lost . Not all the form values but some of them which I create dynamically using java script.

Any help is highly appreciated
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


Not all the form values but some of them which I create dynamically using java script.


Could you mention which form fields are you losing the data? Also, posting your code snippet helps identify the problem better...
 
Ranch Hand
Posts: 948
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not exactly sure what you are doing with JavaScript, but maybe this will help. When you submit your page all the form fields on your page are posted on the request. If you have your forms configured to use request scope, Struts creates a brand new instance of your form and populates it with the values on the request. If validation fails your page is regenerated with just the values that are currently in your form. It might be that you need to populate hidden fields or that you need to execute some JavaScript code when your page is loaded.

- Brent
 
Shruthi Babu
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dynamically created input elements values are lost when validation fails. What could be the reason for this ?
 
Good heavens! What have you done! Here, try to fix it with this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic