Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Feild Level Validation without Refreshing

 
tmsenthil kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need Feild Level validation in jsp page without refreshing.
can anyone pls help me.
 
Afroz Ahmed
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

What do you mean by field level validations exactly?

Like if you want to do validation of an email without submitting,you can use javascript.

write the validate() function logic in the javascript/vbscript and call the validate() function whenever you want.Like when a button is clicked or onfocus etc.

hope this will gives a solution.
 
tmsenthil kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We need every field should get validated on server without refreshing.
 
Kalai Selvan
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I think you can go for client side scripting (i.e. JavaScript), If there is no specific reason for server side validation.

Kalai Selvan T.
 
tmsenthil kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Feild Level Validation using KEYPRESS without Refreshing.
For example my database table two feilds.userid,username.
i hv a text feild in jsp and enter the userid this userid talk to database
and get into the username without refreshing a page.
can any one help me.
 
Kalai Selvan
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
One solution for your problem is, you can have two frames in a jsp page, one is visible and another hidden. visible frame will contain the actual display jsp page. On the kepress or whatever event you can pass the data from the visible frame to the hidden frame jsp form and submit the form. This will do the server side processing and return the data, which can be updated to the visible frame using javascript.




The above code fragment may not be cent percent correct(syntactically), but it will give fair amount of idea..

Kalai Selvan T.
 
Julian Kennedy
Ranch Hand
Posts: 823
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Kalai Selvan T's solution is a good one, but I don't see what the big deal with refreshing is. If you don't want the page to change just return the same data in the response (after validation) as you did the first time. It seems a lot of trouble to go to for no obvious benefit.

Jules
 
Rovas Kram
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm with Jules on this one. Tmsenthil, you do realize that in order to get the server to do something, you must submit a request and the browser will always display the response from that request? Where do plan to display the results from the validation?
[ August 11, 2004: Message edited by: Rovas Kram ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You know actually thinking about this.

If you had what tmsenthil wanted, you have a thick client. So if you want to stay in the browser world, then you would use an Applet instead of a web page. The Applet could then create a SocketConnection to do RMI type calls.

Web pages are a request/response stateless paradigm.

Mark
 
tmsenthil kumar
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank u for ur inputs.I got a solution using XMLHTTP to do server side validation without page refreshing.Can any one pls tell me any alternate idea?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic