This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSP and the fly likes Find duplicate value in jsp page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Find duplicate value in jsp page" Watch "Find duplicate value in jsp page" New topic
Author

Find duplicate value in jsp page

Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 206

Hi all Ranchers,

I am facing a problem with jsp page I have a JSP page and I am checking One filed value(Invoice No)to be unique using servlet(select query)but the disadvantages is that its a big form and
when it goes to the action Servlet then if it find the same value in the database then an alert message (Ok) is going the same page that is right but all fields again need to be fill their values i
want to check on the submit button through javascript but it checking only first value (If i use select qry on the same jsp and validate the page )

how to resolve this problem please tell me
I'll appriciate that

Thanks in advance!!
J Srinivas rao
Greenhorn

Joined: Feb 25, 2011
Posts: 9
Hi

use the ajax to perform the validation and display the error message if it is duplicated , using ajax could be better instead of submitting the form
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 206

Thank you for reply very soon ok i'll try if you have any example can you send me right now

Thanks once again!!
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 206

Hi,
Thanks for suggest me I got the solution using ajax and its running successfully on the same jsp page on onkeyup function().........

Thanks once again!!
J Srinivas rao
Greenhorn

Joined: Feb 25, 2011
Posts: 9
Hi

Better you can perform this operation in onblur event
Rd Dari
Ranch Hand

Joined: Feb 22, 2010
Posts: 206

Ya its same working on onBlur event......

What exact difference between both please guide me in a best way..

Thanks!!
 
Consider Paul's rocket mass heater.
 
subject: Find duplicate value in jsp page
 
Similar Threads
help needed immediately
Need Solution for accesing Action servlet only on Submit
Edit form data with radio buttons
Problems with sessions
remitting values