struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jignesh(india)" <jigne...@aspl.in>
Subject Automatic form submission using javascript in struts2
Date Fri, 07 Dec 2007 05:25:35 GMT

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.
-- 
View this message in context: http://www.nabble.com/Automatic-form-submission-using-javascript-in-struts2-tf4960335.html#a14207071
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message