buszter Posted January 8, 2012 Share Posted January 8, 2012 helloI have a prestashop and there I'd like to make a popup script to check people do they have 18 years old.I thought I'd use this<html><head><script type="text/javascript">function show_confirm(){var r=confirm("Press a button");if (r==true){alert("You pressed OK!");}else{alert("You pressed Cancel!");}}</script></head><body><input type="button" onclick="show_confirm()" value="Show confirm box" /></body></html>Here I wanted to change that when clkick on OK button than goes to the site when click on the cancel button goes to the google.I dont know javascript just html. and what are fount href links are all not good here.so can you help me with this ?Thenks already for your help. Link to comment Share on other sites More sharing options...
birbal Posted January 8, 2012 Share Posted January 8, 2012 http://w3schools.com/jsref/met_loc_replace.asp you can redirect it depending upon which button was clicked Link to comment Share on other sites More sharing options...
eTianbun Posted January 9, 2012 Share Posted January 9, 2012 if(r==true){location.href="http://www.site.com"}else{location.href="google.com"} Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.