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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Onload event to run action

Status
Not open for further replies.

JSMITH242B

Programmer
Mar 7, 2003
352
GB
Sorry if you've come across this post in the ASP forum. Someone suggested I try here....

How can I amend the following code so that it runs without a submit button?
I included the submit button to check that it renders properly without any errors. Now that I've tested it, I want to run it without a submit button.

cheers

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>My test Reports</title>
</HEAD>
<body MS_POSITIONING="GridLayout">
<form id="frmRender" action=" method="post"
target="_self">
<input type="hidden" name="rs:Command" value="Render&CreationDate">
<input type="hidden" name="rc:Toolbar" value="false">
<input type = "hidden" name=Creation value= '01/06/2004'>
<input type="submit" value="view report">
</form>
</body>
</HTML>
 
First, should validate your code at


If you want to automatically submit a form, you can use:
Code:
document.getElementById('frmRender').submit();

This can be done in the onload event handler:
Code:
<body onload="document.getElementById('frmRender').submit();">

or on the page below the </form> tag inside script tags:
Code:
<script language="javascript" type="text/javascript">
document.getElementById('frmRender').submit();
</script>

Lee
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top