• Post Reply Bookmark Topic Watch Topic
  • New Topic

server side validation for each input tag

 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I am working on a ERP web based applications, where in i am having
15-20
inputs in my html forms.now these input are such that i need to
provide
validations for each of them, until each field is not validated the
user is restricted to enter the next field.So i need a server side
validation
for each of my input.
Now for 15 input i have to call a servlet so many times and suppose
if my
application is distributed then for these validations i need to inovoke
the
servlets remotely.
Is there any other way out where i can do the same without invoking
the
servlets as this is going to hamper the performance and the overall
process
time. please help.I could think of a freely available database i.e
MySql/Postgres for validating these inputs, these could act as local
datbase
and after these validations are done then it could be stored in the
central
depository.
 
Bosun Bello
Ranch Hand
Posts: 1511
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are I would do is read all the input parameters and validate them, and send a message back to the client indicating the fields that did not pass the validation. Making a trip to the server for each field will be very resource intensive.
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ur point is rite, but my concern is i have to do the validation at each input only as the forms are a part of the transaction which goes on for three four pages and if I do the validation at the end iam making the user fill the entire three pages agian or the required fields which are wrong again.There is a way described in Struts framework i.e model 2 architecture which deals with this problem, get to have a look inot that
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may want to consider doing some (if not all) of your validation on the client side through JavaScript. That way, you can perform your validation on the fly without incurring a server hit. Then, when the page is finished and the user submits it, you can finish up any remaining validation (if needed) and then continue to the next page.
Corey
 
Rishi Singh
Ranch Hand
Posts: 321
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iam doing the client-side validation using javascript, but unfortunately almost all the inputs do require a server-side validation.
Was just wondering whether server side validation can be done using javascript i.e LiveConnect and whether it involves hits to the server..?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!