faqts : Computers : Programming : Languages : JavaScript : Forms : Buttons

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

31 of 49 people (63%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

Can I change the Action value of a button programmatically

Jun 3rd, 2002 11:06
Luiz Paulo Rosa, Alex Murphy,


You can change the action value of a form using the code below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="Luiz Paulo C. Rosa">
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="pag1.htm" name="frmTeste">
<INPUT TYPE="button" value="submit" 
onClick="document.frmTeste.action='pag2.htm';document.frmTeste.submit
()">
</FORM>
</BODY>
</HTML>