marccesar Posted June 7, 2006 Share Posted June 7, 2006 im having trouble finding a function that will let me do the following:when user clicks a certain href it will delete a row from my database (by submitting the form to another php page which carries this out)... before it does that i would like it to prompt the user asking 'are you sure you want to delete so and so?' with a YES and CANCEL button. if yes - it goes to the delete page, if cancel, it stays put.how do i do this?? i haven't been able to find anything about this!thanks in advance!marc Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/ Share on other sites More sharing options...
trq Posted June 7, 2006 Share Posted June 7, 2006 Thats because message boxes and the like are client-side, javascript, not php. Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/#findComment-42999 Share on other sites More sharing options...
xyph Posted June 7, 2006 Share Posted June 7, 2006 Just put this in your delete link<a href="delete.php" onclick="javascript:return confirm('Are you sure you want to delete this entry?\n(It cannot be undone)')">LINK</a> Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/#findComment-43000 Share on other sites More sharing options...
Woodburn2006 Posted June 13, 2006 Share Posted June 13, 2006 [!--quoteo(post=381206:date=Jun 7 2006, 11:57 PM:name=xyph)--][div class=\'quotetop\']QUOTE(xyph @ Jun 7 2006, 11:57 PM) [snapback]381206[/snapback][/div][div class=\'quotemain\'][!--quotec--]Just put this in your delete link<a href="delete.php" onclick="javascript:return confirm('Are you sure you want to delete this entry?\n(It cannot be undone)')">LINK</a>[/quote]i am also trying to do this, but if you put it inside a PHP echo statement it does not work, any ideas?i tried this:<?echo "<a href='delete_supplier.php' onClick='return confirm('Are you sure that you want to delete this supplier?');'>Delete You</a>"?>it will still continue to the delete page but will not display the message box Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/#findComment-45023 Share on other sites More sharing options...
poirot Posted June 13, 2006 Share Posted June 13, 2006 [code]echo "<a href='delete_supplier.php' onClick='return confirm(\"Are you sure that you want to delete this supplier?\");'>Delete You</a>"[/code] Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/#findComment-45025 Share on other sites More sharing options...
Woodburn2006 Posted June 13, 2006 Share Posted June 13, 2006 [!--quoteo(post=383271:date=Jun 13 2006, 03:02 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 13 2006, 03:02 PM) [snapback]383271[/snapback][/div][div class=\'quotemain\'][!--quotec--][code]echo "<a href='delete_supplier.php' onClick='return confirm(\"Are you sure that you want to delete this supplier?\");'>Delete You</a>"[/code][/quote]thanks very much, works fine [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /] Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/#findComment-45026 Share on other sites More sharing options...
mark s Posted June 13, 2006 Share Posted June 13, 2006 I use this[code]echo "<TD WIDTH=\"60\" ALIGN=\"CENTER\"> <A HREF=\"$PHP_SELF?action=is_spam\" onClick=\"return confirm('Will be Changed to SPAM');\"> Change</A> </TD>\n";[/code] Hope that helps :) Quote Link to comment https://forums.phpfreaks.com/topic/11451-message-box-prompt/#findComment-45028 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.