prime Posted October 15, 2007 Share Posted October 15, 2007 I'm running a php script, there's a lot of code so I wont post that unless neccessary. what I'm trying to do is I have a form button as follows <form action=\"$thisfile\" method=\"post\" bgcolor=\"orange\"> <input type=\"hidden\" name=\"deletename\" value=\"$name\"> <input type=\"hidden\" name=\"deleteentry6576\" value=\"TRUE\"> <input value=\"Delete\" type=\"submit\" /></form> Now I have this form button link to a php script which deletes an entry from a mysql database, now I[m relatively new to Javascript, and I know you can post an are you sure box bu doing confirm("Are you Sure you wish to delete this entry"); What I'm having problems doibng is implementing this with the form button, what I wont is a yes or no option, if yes well go ahead and do it, otherwise do nothing Link to comment https://forums.phpfreaks.com/topic/73377-solved-are-you-sure-you-wish-to-continue/ Share on other sites More sharing options...
hostfreak Posted October 15, 2007 Share Posted October 15, 2007 Is this what you are looking for: <input value="Delete" type="submit" onclick="return confirm('Are you Sure you wish to delete this entry?');" /> Link to comment https://forums.phpfreaks.com/topic/73377-solved-are-you-sure-you-wish-to-continue/#findComment-370242 Share on other sites More sharing options...
prime Posted October 15, 2007 Author Share Posted October 15, 2007 yes that is exactly what I need, but since it's inside the php tags, I'm having a problem where to implement the <script type="javascript"></script> tags for that onclick event .. as I said I've been doing php for a while now but very new to JavaScript Link to comment https://forums.phpfreaks.com/topic/73377-solved-are-you-sure-you-wish-to-continue/#findComment-370247 Share on other sites More sharing options...
prime Posted October 16, 2007 Author Share Posted October 16, 2007 nvm I got it working, I was trying to over complicate matters <form action=\"$thisfile\" method=\"post\" bgcolor=\"orange\"> <input type=\"hidden\" name=\"deletename\" value=\"$name\"> <input type=\"hidden\" name=\"deleteentry6576\" value=\"TRUE\"> <input value=\"Delete\" type=\"submit\" onClick=\"return confirm( 'Are you sure you want to delete this entry?');\"></form> Link to comment https://forums.phpfreaks.com/topic/73377-solved-are-you-sure-you-wish-to-continue/#findComment-370279 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.