Jump to content

Message Box / Prompt!!


marccesar

Recommended Posts

im having trouble finding a function that will let me do the following:

when user clicks a certain href it will delete a row from my database (by submitting the form to another php page which carries this out)... before it does that i would like it to prompt the user asking 'are you sure you want to delete so and so?' with a YES and CANCEL button. if yes - it goes to the delete page, if cancel, it stays put.

how do i do this?? i haven't been able to find anything about this!

thanks in advance!

marc
Link to comment
Share on other sites

[!--quoteo(post=381206:date=Jun 7 2006, 11:57 PM:name=xyph)--][div class=\'quotetop\']QUOTE(xyph @ Jun 7 2006, 11:57 PM) [snapback]381206[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Just put this in your delete link

<a href="delete.php" onclick="javascript:return confirm('Are you sure you want to delete this entry?\n(It cannot be undone)')">LINK</a>
[/quote]

i am also trying to do this, but if you put it inside a PHP echo statement it does not work, any ideas?

i tried this:

<?
echo "<a href='delete_supplier.php' onClick='return confirm('Are you sure that you want to delete this supplier?');'>Delete You</a>"
?>

it will still continue to the delete page but will not display the message box
Link to comment
Share on other sites

[!--quoteo(post=383271:date=Jun 13 2006, 03:02 PM:name=poirot)--][div class=\'quotetop\']QUOTE(poirot @ Jun 13 2006, 03:02 PM) [snapback]383271[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]echo "<a href='delete_supplier.php' onClick='return confirm(\"Are you sure that you want to delete this supplier?\");'>Delete You</a>"[/code]
[/quote]

thanks very much, works fine [img src=\"style_emoticons/[#EMO_DIR#]/laugh.gif\" style=\"vertical-align:middle\" emoid=\":laugh:\" border=\"0\" alt=\"laugh.gif\" /]
Link to comment
Share on other sites

I use this

[code]echo "<TD WIDTH=\"60\" ALIGN=\"CENTER\">
            <A HREF=\"$PHP_SELF?action=is_spam\"
               onClick=\"return confirm('Will be Changed to SPAM');\">
            Change</A>
            </TD>\n";[/code]

Hope that helps :)
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.