Try this: <html:form action="/something.do" styleId="myFrm"> .... </html:form>
<input type="button" onClick="javascript:callSubmit()"> <script language="javascript"> function callSubmit() { frm = document.getElementById("myFrm"); frm.submit(); } </script> Note that styleId attribute in html:form tag will be rendered as an id html attribute (see Struts documentation). So you will have a way for locating the form from javascript since the html node has an identifier, no matter if the function is called from a button outside the form. Once into the javascript function you can easily locate the form and call its submit method. Since you are using DOM (getElementById), it will run on any standard browser. On Sat, 9 Oct 2004 20:59:10 +0530, sachin <[EMAIL PROTECTED]> wrote: > hello all , > > i have a struts form and a button outside the form. > on button click , with javascript i need the submit the form > > any help is welcome. > > My code is like following. but does not work > > <html:form action="/something.do"> > .... > </html:form> > > <input type="button" onClick="javascript:callSubmit()"> > > <script> > function callSubmit() { > document.forms[0].submit(); > } > </script> > > Sachin Hegde > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]