Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatic form post

Status
Not open for further replies.

md2932

Programmer
Mar 10, 2003
2
0
0
US
Hey gang,

I searched the forums for this, but couldn't find anything...

Is there any way for the "submit" button to be automatically pressed without the user having to click on it??

I'm calling this page as a link from another frame. Basically, I want it to set some up some static values for the "validate.asp" page, and then 'auto-submit' the form. I'm re-using the "validate.asp" page from another section of the same website, and I don't wont to have to reinvent the wheel! Today, the code opens a button that the user has to click to proceed. [neutral]

Here's the code I'm using:

Code:
<HTML>
<HEAD>
</HEAD>
<FORM ACTION=&quot;validate.asp&quot; METHOD=&quot;POST&quot;>
  <table WIDTH=&quot;100%&quot;>
    <tr><td><INPUT TYPE=&quot;Submit&quot; VALUE=&quot;Go&quot;></td></tr>
  </table>
  <INPUT TYPE=&quot;hidden&quot; Name=&quot;Type&quot; VALUE=&quot;RED&quot;>
  <INPUT TYPE=&quot;hidden&quot; Name=&quot;Section&quot; VALUE=&quot;BLUE&quot;>
  <INPUT TYPE=&quot;hidden&quot; Name=&quot;Group&quot; VALUE=&quot;ALL&quot;>
  <INPUT TYPE=&quot;hidden&quot; Name=&quot;Key&quot; VALUE=&quot;&quot;>
</FORM>
</BODY>
</HTML>
 
Code:
<body onload=&quot;document.forms[0].submit();&quot;>

-pete
 
Doesn't work for me....
What do I do wrong....
Here's my code...
;)

<cfquery name=&quot;hackwyswertcom&quot; datasource=&quot;hacks&quot;>
SELECT * FROM &quot;all&quot;
</cfquery>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body onload=&quot;document.forms[0].submit();&quot;>
<TABLE width=&quot;404&quot; border=0 cellPadding=0 cellSpacing=0>
<FORM action= method=post>
<TBODY>
<TR>
<TD width=&quot;434&quot; noWrap><FONT face=verdana,arial,helvetica size=1><B>Not cookied?</B><BR>
Login with username and password:</FONT></TD>
</TR>
<TR>
<TD noWrap><INPUT type=hidden
value=32703010b23f4ba74f02567e29b4660b name=s>
<input
type=hidden value=login name=action>
<INPUT name=username class=bginput value=&quot;<cfoutput>#hackwyswertcom.username#</cfoutput>&quot;
size=25>
<INPUT name=password type=password class=bginput value=&quot;<cfoutput>#hackwyswertcom.password#</cfoutput>&quot;
size=25> <INPUT name=&quot;submit&quot; type=submit class=bginput value=Login!></TD>
</TR>
</FORM>
</TABLE>
</body>
</html>
 
name your submit button something other than &quot;submit&quot;, or nothing at all:


:-(
<INPUT name=&quot;submit&quot; type=submit class=bginput value=Login!>

:)
<INPUT name=&quot;btnSubmit&quot; type=submit class=bginput value=Login!>

=========================================================
while (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top