There doesn't appear to be anything wrong with the script. You might try it from another workstation.
As to the underlying use case, it appears that we would like to open a PHP page form a Struts Action. Another way to do that in Struts 2 would be to redirect with parameters. Something like this might work: <action name="secureResponse" class="..."> <result name="secureResponseResult" type="redirect"> <param name="location">http://24.practice.jad/www_new/merchantRespo.php</param> <param name="serviceid">${serviceId}</param> <param name="customerid">${customerId}</param> </result> </action> Or using annotation @Result ( name = "secureResponseResult", value = "http://24.practice.jad/www_new/merchantRespo.php", type = ServletRedirectResult.class, params = {"serviceId", ${serviceId},"customerid", ${customerId} ) -- HTH, Ted * <http://www.StrutsMentor.com/> On Dec 7, 2007 12:25 AM, jignesh(india) <[EMAIL PROTECTED]> wrote: > > Hi, > > I want to submit my <form automatically from resulted jsp in struts2 using > javascript at the time of page loaded. > I have tried ordinary javascript but it is not working..like > document.frmname.submit(),document.forms[0].submit(); > > Can anyone help me why it isn't working. > > My code:- > > <body> > <form name="secureResponsefrm" method="post" > action="http://24.practice.jad/www_new/merchantRespo.php" id="frmid"> > <s:hidden name="serviceid"/> > <s:hidden name="customerid"/> > <s:submit name="submit" value="Submit" id="submit"/> > </form> > </body> > > <script type="text/javascript"><!-- > document.forms[0].submit(); > //--></script> > > > Each time page loaded it calls the script but giving javascript error > message- > > Error:- > document.forms[0].submit is not a function > //--></script> > > Thanks in advanced. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]