Forum Moderators: open
If they click on the first submit button, I want another window to open, and the request to be submitted.
If they click on the second submit button, I want another window to open, the request to be submitted, and then the user to be redirected to a different page.
FOr example: I am working in document main.htm. popup.htm pops up, the request is submitted, and then main.htm is redirected to main2.htm.
So far the first part works, I use this
<form name="acctForm" method="post" action="popup.htm" target="_new">
And the new window pops up and the submit goes perfectly.
However, the second part, I cannot seem to reditrect the main page after the request is submitted. It gives me a javascript error when I try to do something like this:
<INPUT TYPE="submit" VALUE="Submit & Redirect" onClick="javascript:window.location("main2.html")>
Please help. It says action is not supported.
try
onClick="javascript:location.href='main2.html';">
instead.
I don't think it's a good idea to have two submit buttons on one form. Hopefully someone will come along and explain why and help you out. Way past my bed time.
Hope you sort it.
"...I don't think it's a good idea to have two submit buttons on one form. Hopefully someone will come along and explain why and help you out. Way past my bed time...."
Now you've got me curious. So if no-one does come along and explain why while you are asleep, could you please explain in your morning
Thanks
Shawn
My tired thoughts where that with mshahMCS page with 2 submit buttons to one form, and the sole use of JavaScripting to sort out what happens on submission was not the best approach. If you get 100,000 uniques a month and 8% have non scripting enabled browsers that’s... erm... possibly 8000 bad experiences on your web site per month.
People expect one send button, two buttons could confuse. I would have thought a better solution is to design the form so that there’s no need for more than one submit and use server side script to action.
Maybe I should have said
...I don't think it's a good idea to have two submit buttons on one form and only use Client side scripts to sort out the behaviours
I stand corrected, though I think I might go back to bed..