rainemaida Posted April 2, 2007 Share Posted April 2, 2007 I am currently trying to add a Javascript function to a ahref in an echo statement. echo '<a href="coursedocumentsstaff.php?id='.$row['id'].'">Remove </a>'; I want to add the following to it.. onclick="return (confirm('do you really want to delete the stuff?'));" Please can you help me out. Thank you, Steve Link to comment https://forums.phpfreaks.com/topic/45267-solved-javascript-with-php/ Share on other sites More sharing options...
trq Posted April 2, 2007 Share Posted April 2, 2007 Whats the problem? Link to comment https://forums.phpfreaks.com/topic/45267-solved-javascript-with-php/#findComment-219785 Share on other sites More sharing options...
jitesh Posted April 2, 2007 Share Posted April 2, 2007 <a href="file.php" onclick="javascript:return confirmation()"> <script language="javascript"> function confirmation(){ if(!confirm("Are you sure ?")){ return false; } } </script> Link to comment https://forums.phpfreaks.com/topic/45267-solved-javascript-with-php/#findComment-219791 Share on other sites More sharing options...
rainemaida Posted April 2, 2007 Author Share Posted April 2, 2007 Thank you very much, that was a good way to get around it, very much appriciated. Cheers, Steve Link to comment https://forums.phpfreaks.com/topic/45267-solved-javascript-with-php/#findComment-219795 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.