Jump to content

[SOLVED] Are you sure you wish to continue


prime

Recommended Posts

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

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

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>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.