PDA

View Full Version : Submitting to different pages


codefox
01-28-2003, 12:51 PM
I have a form which submits to a page named "submit_page1.asp"

<FORM name="frm" ... action="submit_page1.asp">...

I have two buttons, one of which is a submit button and the other one is of type "button", as in

<INPUT type="submit">
<INPUT type="button" onClick="submitToPage2();">

My submitToPage2() is like this:
function submitToPage2()
{
frm.action = "submit_page2.asp
frm.submit();
}


This works fine in IE, but doesn't work in Mozilla. How do I submit to a different page in Mozilla?

Thanks.

requestcode
01-28-2003, 01:12 PM
You might try having your form tag like this:
<FORM name="frm" ... action="">..

Then your function like this:
function submitToPage(subpage)
{
frm.action = subpage
frm.submit();
}

Then your two buttons like this:
<INPUT type="button" onClick="submitToPage('submit_page1.asp');">
<INPUT type="button" onClick="submitToPage('submit_page2.asp');">