anderson_catchme Posted August 18, 2014 Share Posted August 18, 2014 <td> <button onclick="alertdialog()"><span class="glyphicon glyphicon-trash"> </span></button></td><script>function alertdialog(){ window.confirm("Are you sure you want to delete this post?");}</script> This is my code. I need to have a callback to a PHP script when a user decides to delete a post. I think html POST is the most unobtrustive way to do this. What's the easiest / most robust way to send data to a script when the user clicks OK? Appreciated. Mark Quote Link to comment https://forums.phpfreaks.com/topic/290506-noob-q-simple-js-alert-post-callback-to-php-script/ Share on other sites More sharing options...
PravinS Posted August 18, 2014 Share Posted August 18, 2014 you can use AJAX Quote Link to comment https://forums.phpfreaks.com/topic/290506-noob-q-simple-js-alert-post-callback-to-php-script/#findComment-1488093 Share on other sites More sharing options...
gristoi Posted August 18, 2014 Share Posted August 18, 2014 if you are using the glyphicons am going to bet you are using bootstrap, if this is the case just use a compination of bootstrap modal and an ajax call to the back end on confirmation Quote Link to comment https://forums.phpfreaks.com/topic/290506-noob-q-simple-js-alert-post-callback-to-php-script/#findComment-1488148 Share on other sites More sharing options...
anderson_catchme Posted August 18, 2014 Author Share Posted August 18, 2014 you can use AJAX How specifically? Quote Link to comment https://forums.phpfreaks.com/topic/290506-noob-q-simple-js-alert-post-callback-to-php-script/#findComment-1488227 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.