php_newB Posted March 27, 2007 Share Posted March 27, 2007 Hi I am trying to attach a warning message to a delete buttton. so if the user click on delete article it will prompt a warning message and ask for confirmation. I have the following javascript in the main page to get the article information: <script language="JavaScript"> function delArticle(id, title) { if (confirm("Are you sure you want to delete '" + title + "'")) { window.location.href = 'http://localhost/delete.php'; } } </script> then I have delete button which calls delete.php (where I coded delete function) to execute delete function. where should I include the javascript code to call the delArticle() function? is there any way that I can call this from my delete.php file? like somehow include this: javascript:delArticle('<?php echo $id;?>', '<?php echo $title;?>' in there. many thanks... Link to comment https://forums.phpfreaks.com/topic/44551-help-with-delete-button-warning-message/ Share on other sites More sharing options...
php_newB Posted March 27, 2007 Author Share Posted March 27, 2007 problem solved here ;D Link to comment https://forums.phpfreaks.com/topic/44551-help-with-delete-button-warning-message/#findComment-216430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.