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 ? Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
jd2007 Posted July 19, 2007 Author Share Posted July 19, 2007 yes Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. 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.