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
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

Link to comment
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.