• Post Reply Bookmark Topic Watch Topic
  • New Topic

Server-side validation

 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ranchers,

I have an application in which I have to do a server-side validation. It happens because according to the selected project (entity) in a drop-down list a certain period of date (text box) is allowed. My problem is that I can't keep the fields with the value inserted if that validation occurs to return false. How can I "save" the values in the fields so when the validation completes they still have them?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the input elements' value attribute to set the initial value of the controls when you return to the page after failing validation.
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's what I have in mind. My problem is where (and how) do I store the values typed by the user before he had clicked the confirm button. The fields are initially blank.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you care what's in the fields before submission? Only the values that are submitted are important -- and you obviously have those in hand as you are validating them.
 
Eduardo Bueno
Ranch Hand
Posts: 155
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cleared my mind, thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!