struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Steele" <>
Subject struts unwillingly submitting form when using javascript to validate
Date Fri, 26 Jul 2002 16:02:12 GMT
Hi all,

Thanks in advance for any help.

Has anyone encountered an instance in which struts 1.0.2 submits a form without a submit button
or a javascript call to submit()?

I'm using javascript to validate my form.  This is an extensive library of validation functions
i've built up over many years and is fully tested, reliable, etc.  In short, i recurse through
the javascript DOM to find any fields that require validation.  If the required fields pass
the validation, I call "document.forms[ xx].submit()" otherwise an error message is displayed
via an alert popup and no call to submit is made.

Somehow Struts is submitting the form anyway, even when I have no submit button or js call
to submit ANYWHERE on the page.  The server logs show that struts starts processing the post
after the javascript finishes (and no submit is called).

I'm running this on JRun 3.1

Here's the relevant code:

<html:form action="updateEmployee">
<html:image src="images/send.gif" alt="Send" onclick="javascript:validateForm( '3' );"
/> **** 3 is the dom order of the form (4th form on page)****


---struts log ----- (reverse chronological)

07/26 11:13:59 info (JRun) payroll: Looking for Action instance for class

  [1176]   07/26 11:13:59 info (JRun) payroll: No errors detected, accepting input 
  [1175]   07/26 11:13:59 info (JRun) payroll: Validating input form properties 
  [1174]   07/26 11:13:59 info (JRun) payroll: Populating bean properties from this request

  [1173]   07/26 11:13:59 info (JRun) payroll: Storing instance under attribute 'employeePlanForm'
in scope 'request' 
  [1172]   07/26 11:13:59 info (JRun) payroll: Creating new ActionForm instance of class ''

  [1171]   07/26 11:13:59 info (JRun) payroll: Looking for ActionForm bean under attribute
  [1170]   07/26 11:13:59 info (JRun) payroll: Processing a POST for /updateEmployee


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

View raw message