SephirGaine Posted September 21, 2006 Share Posted September 21, 2006 Hey ya'll. Basically, I want to have two submit buttons, each going to a different page. I figure I'll lead one like normal, and have it go to my action="" page.But, my second one I want to go to a seperate page. I understand that Javascript works for this using the onClick tag, but I haven't been able to get it working. So far..[code]onClick="parent.location='closelead.php'[/code]That's what I'm working with. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/21588-onclick-used-in-a-form/ Share on other sites More sharing options...
shadowcaster Posted September 21, 2006 Share Posted September 21, 2006 Are you trying to change a framed page? or open it in a new window? Quote Link to comment https://forums.phpfreaks.com/topic/21588-onclick-used-in-a-form/#findComment-96392 Share on other sites More sharing options...
snorkler Posted September 22, 2006 Share Posted September 22, 2006 How about leading the action to the same page, and then using a switch function on that page to insert the relevant script/s based upon the value of the Submit buttons? Quote Link to comment https://forums.phpfreaks.com/topic/21588-onclick-used-in-a-form/#findComment-96443 Share on other sites More sharing options...
SephirGaine Posted September 22, 2006 Author Share Posted September 22, 2006 [b]shadowcaster[/b]: Just in the same page will work fine. So preferably, that'll be my route.[b]snorkler[/b]: That was an idea that came to mind, but it seems to be a lot more work than deems necessary. If there's a way to basically have 2 submit buttons on a single form, each leading to different pages, that'll save me time, effort, and probably a bit of frustration to do it that way. If this falls through that's what I'll do however. Quote Link to comment https://forums.phpfreaks.com/topic/21588-onclick-used-in-a-form/#findComment-96446 Share on other sites More sharing options...
fenway Posted September 22, 2006 Share Posted September 22, 2006 You can have 2 submit buttons... but only one action per form, unless you want to play very silly JS games. Alternatively, you can have the server-side script perform the necessary redirects if applicable. Quote Link to comment https://forums.phpfreaks.com/topic/21588-onclick-used-in-a-form/#findComment-96612 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.