• Post Reply Bookmark Topic Watch Topic
  • New Topic

Default Value on the web page  RSS feed

 
Ranch Hand
Posts: 69
  • 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.
 
Bartender
Posts: 9494
12
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.
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!