Mutley Posted January 25, 2009 Share Posted January 25, 2009 <script language='javascript'> var name = confirm("Are you sure you wish to purchase a <?=$conMan?> <?=$conNam?>?"); if(name==true){ window.location.href='shop.php?cat=<?=$cat?>&prod_id=<?=$prod_id?>&confirm=1'; }else{ window.location.href='shop.php?cat=<?=$cat?>'; } </script> It pops up but when you select "Okay" it doesn't do anything... like it isn't true? Quote Link to comment Share on other sites More sharing options...
webster08 Posted January 25, 2009 Share Posted January 25, 2009 you need to check the window.location.href in your if/else condition and use the confirm accordingly; don't check if the confirm is true or false. Quote Link to comment Share on other sites More sharing options...
Mutley Posted February 7, 2009 Author Share Posted February 7, 2009 How do you mean, sorry? Quote Link to comment Share on other sites More sharing options...
webster08 Posted February 7, 2009 Share Posted February 7, 2009 what are you trying to accomplish? i think you just need to google "javascript confirm prompt"; that will put you in the right direction. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 7, 2009 Share Posted February 7, 2009 Try changing window.location.href to window.location. Quote Link to comment Share on other sites More sharing options...
Mutley Posted February 13, 2009 Author Share Posted February 13, 2009 Tried that but no luck. I'm trying to do a simple, if confirmation is Yes, redirect to XYZ page, if not, redirect to ABC page. Quote Link to comment Share on other sites More sharing options...
corbin Posted February 13, 2009 Share Posted February 13, 2009 Hrmm works fine for me x.x if I just put http://google.com/ as one location and http://msn.com/ as the other. Quote Link to comment 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.