jd2007 Posted July 19, 2007 Share Posted July 19, 2007 how do i use php check wheter the OK button was clicked on a confirm box ? Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/ Share on other sites More sharing options...
chigley Posted July 19, 2007 Share Posted July 19, 2007 if(isset($_POST["confirm"])) // Do something Make sure that the confirm box has a value to it in the HTML and that should do the job Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302313 Share on other sites More sharing options...
dbo Posted July 19, 2007 Share Posted July 19, 2007 Did you mean one of those javascript confirm things? If so I don't think you can get that value in PHP... but could be mistaken. Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302332 Share on other sites More sharing options...
jd2007 Posted July 19, 2007 Author Share Posted July 19, 2007 yes Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302346 Share on other sites More sharing options...
dbo Posted July 19, 2007 Share Posted July 19, 2007 The only way I could see this working is by some fancy Ajax stuff or creating a floating div that "emulates" the confirm popup thing. Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302348 Share on other sites More sharing options...
GingerRobot Posted July 19, 2007 Share Posted July 19, 2007 Well, given that confirm boxes are usually used when you go to submit a form, surely you dont need to? The confirm boxes usually submit the form if the user clicks ok, and dont if dont click ok. So, if the form has been submitted(which is must have been for php to be dealing with it) then you can assume that either javascript is turned off, or the user has confirmed. Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302361 Share on other sites More sharing options...
dbo Posted July 19, 2007 Share Posted July 19, 2007 This is also true... but I usually don't try to understand why people want to accomplish certain things Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302420 Share on other sites More sharing options...
Dragen Posted July 19, 2007 Share Posted July 19, 2007 I'd go with chigley's idea. It's 100% more reliable than javascript anyway. If you submit a form with a javascript check on it, all you need to do is turn javascript off and then your form has no security on it. Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302467 Share on other sites More sharing options...
dbo Posted July 19, 2007 Share Posted July 19, 2007 You're assuming the button on the form is called confirm... which it currently is not. And yeah... only relying on javascript is a bad thing, but nothing posted here says that's the case. Link to comment https://forums.phpfreaks.com/topic/60770-how-do-i-use-php-check-wheter-the-ok-button-was-clicked-on-a-confirm-box/#findComment-302471 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.