How to invoke a Servlet or java method onSubmit ?
I am creating a Form in a Servlet.
e.g
<FORM ACTION="/servlet/addUser" onSubmit=? >
Lastname <INPUT TYPE ="text" NAME =lname >
Firsnname <INPUT TYPE ="text" NAME =fname >
<INPUT TYPE=submit name =submit value ="submit">
Now on hitting the submit button I need to check if a duplicate lastname exists in the database by invoking a servlet method and only if a duplicate does not exist I want to submit the form .
Since as I understand onSubmit can only invoke a Javascript method , how can I really invoke a servlet method to check for duplicate before addUser is invoked.
Thanks
S

