tvks Posted December 19, 2006 Share Posted December 19, 2006 Hi,I have a small javascript code like this:[code]<script language=javascript> function confirmSubmit(days) { var msg; msg= "Confirm for this leave application of "+id+" days"; var agree=confirm(msg); if (agree) { } else { window.location = "http://abc.com/quick/long.php"; } } </script> ?>[/code]My requirement is very simple. In the middle of my php program I need a confirm popup menu to come. If the user selects ok then the process should continue. If the user selects cancel the page must be redirected to long.php.My problem is that, the place where the popup window is required is in an area in the form after the clicking of the submit button. hence I cannot use onclick. It is just in the middle of some calculations.I would also be satisfied with any piece of code there in php for me to design something like the confirm function which does the same activity (without using Javascript).I think "No" is an answer unknown to php.Thanx for any help in advance.Regards,tvks Quote Link to comment Share on other sites More sharing options...
taith Posted December 19, 2006 Share Posted December 19, 2006 no... php doesnt have the ability(that i know of) to forcevly stop in the middle of a script, the only way of doing it would be to split the script up into sections[code]switch($_GET[stage]){ default: #first stage, then header to stage 2 break; case "stage2": yes|no break; case "no": redirect break; case "stage3": #continue break;}[/code] 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.