• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Jeanne Boyarsky
  • paul wheaton
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Ron McLeod
  • Tim Moores
  • salvin francis
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Vijitha Kumara

Default Value on the web page  RSS feed

Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

My application has n number of fields. When user enters the data and submits the form, the form will be submitted and some business logic will be executed on the server side. If there are any validation errors, will be shown on the page. What I want to achieve is, I want to show a default amount of $0.00 in the amount field when the page is loaded for the first time. Right now, I've something like this..

So, when the form first loads, the payments object gets the value from database and pre-populates the amount field with database value. I don't want that value here. I just want a default $0 and when user enters some amount, I want to post it to the database.
Please note that, the form scope is currently request and I cannot make it to session for other reasons.

Any help is really appreciated.
Posts: 9558
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should have an action that prepares the form.  Set the default value for the field in that action.
I've got no option but to sell you all for scientific experiments. Or a tiny ad:
global solutions you can do at home or in your backyard
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!