Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

onclick event in jsp page not working.......

843840Aug 28 2008 — edited Aug 31 2008
Hi,

I am using a submit button to call a servlet function which saves the data in test boxes.

but it doesn't get called on button click, where as gets called when the form loads.......

I want to call the function on the click event.

below is the code.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>

</head>
<body bgcolor="#abcdef">

<form name="Employee" method="POST">


<table cellpadding="2" cellspacing="2" width="100%" >
<tr>
<td width="30%" >
<label style="font-size : 14pt">First Name</label>
<br><br>
<label style="font-size : 14pt">Last Name</label>
<br><br>
<label style="font-size : 14pt">Title</label>
<br><br>
<label style="font-size : 14pt">Username</label>
<br><br>
</td>

<td width="30%" align="left">
<input type="text" name="First_name" value="" width="20">
<br><br>
<input type="text" name="Last_name" value="" width="20">
<br><br>
<input type="text" name="Title_txt" value="" width="20">
<br><br>
<input type="text" name="TxtUsername" value="" width="20">
<br><br>
</td>
</tr>
<td>

<input type="submit" value="Save" onclick="<% c1.btnSave(request,response);%>;" >
<input type="reset" value="Clear" >
</td>
</table>

</form>


</body>
</html>
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 28 2008
Added on Aug 28 2008
7 comments
2,322 views