struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Takhar, Sandeep" <>
Subject RE: Form submit in JavaScript
Date Fri, 02 Apr 2004 19:12:38 GMT
you've spelt it sumbit and submit


-----Original Message-----
From: Ramadoss Chinnakuzhandai []
Sent: Friday, April 02, 2004 2:07 PM
Subject: Form submit in JavaScript


I have the following block of code in my jsp

 <td colspan="3" align="right">
	<html:submit property="command" value="Delete" onclick="sumbitForm('Delete');return true;"/>
	<html:submit property="command" value="Cancel" onclick="sumbitForm('Cancel');return true;"/>
	<html:submit property="command" value="Save" onclick="sumbitForm('Save');return true;"/>

I hv the following JavaScript function inside the same jsp

<script language="javascript">
    function submitForm(input) {       
	   var action;
	   if(input == "Delete") {action = "/tools/admin_employees.rcmx?method=deleteUser";}
	   else if(input == "Cancel") {action = "/tools/admin_employees.rcmx?method=displayUsers";}
	   else if(input == "Save") {action = "/tools/admin_employees_edituser?method=updateCsrAccount";}
	   document.manageCsrAccountsForm.action = action;
	   return true;	   

When I click on Delete/Cancel/Save button it does not actually invoke javascript function
but submit to the action specified in the <html:form action="action">.

Can anybody guide me where I'm doing wrong...or any better way to do this?

Thank for your time,


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message