predator12341 Posted April 19, 2006 Share Posted April 19, 2006 right i have this code below and what it does is if the ok button is pressed on the java pop up it should carry out the code but i dont no how to do thisif($TimeVisit < $CoverTimeStart || $TimeVisit > $CoverTimeFinish || $TodayDay < 01 || $TodayDay > 05){ echo "<script Language=Javascript> var Message = 'This job is a chargable visit because the customer does not have maintenance cover. If you wish to continue click ok.' if (! confirm (Message)) { location.href='../Calendar.php' }what i need to find out is how i can see if the ok button is pressed in this java script bit so i can carry out the correct code (which is of course php) </script>";} else{the code here if the if statment is not metregardsPred Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 19, 2006 Share Posted April 19, 2006 Use a function like the one below, which can be activated onClick.Have it redirect you to a php url with ?buttonClicked=true on the URL or something like that. ??Do you really need to use a javascript alert box? would a splash/holding page with the agree/disagree option not do the trick?[code]<script type="text/javascript"><!--function relocate(){window.location = "http://www.yourdomain.com/yourpage.php?action=whatever"}//--></script><a href="#" onClick="relocate();">Whatever, I agree without reading stuff anyway.</a>[/code] Quote Link to comment Share on other sites More sharing options...
predator12341 Posted April 19, 2006 Author Share Posted April 19, 2006 yea but that will not act as me pop up box will it. as what i have is if cancel is clicked it goes back to a different page. however, if ok is clicked and they wat to go ahead with the booking i need it to use this php script (which uses variables declared earlier on so i really want to keep it all in this one page if it is possible)PS hey again wise wood have a nice weekend. I did lol i got p*ssed out me face a nice way to end the weekecho "<script Language=Javascript> var Message = 'This job is a chargable visit because the customer does not have maintenance cover. If you wish to continue click ok.'if (! confirm (Message)) { location.href='../Calendar.php'}else{ from what i can work out i need a way of putting the php in here }</script>"; Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 19, 2006 Share Posted April 19, 2006 [code]<script Language=Javascript> <!--function predator12341(){var location= confirm("This job is a chargable visit because the customer does not have maintenance cover. If you wish to continue click ok.");if (location== true) { window.location="yourpage.php?clicked=YES"; }else { window.location="yourpage.php?clicked=NO"; }}//--></script><a href="#" onClick="predator12341();">Whatever, I agree without reading stuff anyway.</a>[/code]Yeah pretty good weekend... painted the living room ceiling and FINALLY got round to upgrading the pc to XP.PS. ^^^ That should do it. Quote Link to comment Share on other sites More sharing options...
predator12341 Posted April 19, 2006 Author Share Posted April 19, 2006 [!--quoteo(post=366427:date=Apr 19 2006, 03:10 PM:name=wisewood)--][div class=\'quotetop\']QUOTE(wisewood @ Apr 19 2006, 03:10 PM) [snapback]366427[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]<script Language=Javascript> <!--function predator12341(){var location= confirm("This job is a chargable visit because the customer does not have maintenance cover. If you wish to continue click ok.");if (location== true) { window.location="yourpage.php?clicked=YES"; }else { window.location="yourpage.php?clicked=NO"; }}//--></script><a href="#" onClick="predator12341();">Whatever, I agree without reading stuff anyway.</a>[/code]Yeah pretty good weekend... painted the living room ceiling and FINALLY got round to upgrading the pc to XP.PS. ^^^ That should do it.[/quote]with the above the var's i currently have on the page will not be passed on (and i dont wanna pass them on through the url or anything is there any way around this or can i do what i am trying to another way in php) Quote Link to comment Share on other sites More sharing options...
wisewood Posted April 19, 2006 Share Posted April 19, 2006 Send me a PM with the details of what you're trying to do and i'll see if i can figure out a way of doing it.Give me an idea what you want the user to be presented with after they say "Yes" on the form, and i'll see what i can come up with. 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.