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

Changing form action

Status
Not open for further replies.

TheConeHead

Programmer
Joined
Aug 14, 2002
Messages
2,106
Location
US
I need to have a button that changes a forms action. I tried:

<input type="submit" onclick="document.all.formname.action='newpage.asp'">

What am I doing wrong?

[conehead]
 
[tt]<input type="submit" onclick="docume[highlight]nt.fo[/highlight]rmname.action='newpage.asp'">[/tt]
or, as an alternative, you can simply do it like this, then no hardcoded formname is then required.
[tt]<input type="submit" onclick="this.form.action='newpage.asp'">[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top