Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Form forgets data after validate method returns errors

 
Eric Juneau
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to retain the non-writable data in a form without a bunch of hidden fields?

Say I have a form that contains various fields, some are read-only, some are writable. If the validate method in the form executes and returns an error, all the data on the form, except for the writable fields disappears. Is there a way to retain this data without having a html:hidden field for each read-only field?
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eric,
Welcome to JavaRanch!

You do need the hidden fields to submit the data to the server. You can then store it in the session to avoid keeping it from being sent back and forth extra times though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic