robcrozier Posted April 13, 2006 Share Posted April 13, 2006 hi does anyone know how i can create an 'ok' 'cancel' confirmation box in javascript than when the 'ok' button is clicked it pases a variable through the url to another php page?I know how to pass the variable through the url with php when a link is clicked on, however im a bit stumped when it comes to incorporating a javascript message box too!heres the code i use to pass the variable normally:[code]echo"<a href='delete_entry.php?title=$nt[title]'>Delete this entry</a>";[/code]any help would be appreciated!cheers! Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 13, 2006 Share Posted April 13, 2006 Something like this should give you a clue.Put this in the head section of the document which contains the popup.<script type="text/javascript"><!--function redirect(){window.location = "your_document.php?id=<?=$_GET[id]?>"}//--></script>you can then use onClick='redirect();' assigned to whatever you want, and it'll redirect you to the apge specified in the window.location.Hope this helps.PS. If you need to do a javascript popup, just google it. 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.