Jump to content
houssam_ballout

javascript confirm , change title

Recommended Posts

Hello all,I was searching for a javascript in which I can change the confirm box title, I had found this http://www.abeautifulsite.net/blog/2008/12/jquery-alert-dialogs/but I need help how to make it on a hyperlink, as in my page, I had <a href="test.php?action=del&id=1>Delete</a>the above link works perfect with button, how can I make it work on a href so that when I click on the Delete text, I get the confirmation with Yes , Cancel option, when clicked Cancel, it will do nothing and Yes will delete the record

Share this post


Link to post
Share on other sites

what code do you have so far? which part are you getting stuck on? have you looked through the tutorials to get the basics? getting a reference to an object, knowing what properties it has, etc and what you can change...

Share this post


Link to post
Share on other sites

Look at this example under confirm:http://labs.abeautifulsite.net/archived/jquery-alerts/demo/I need help in making it in <a href=""></a>also, my current code makes look from the database, so in the current code, with the <input type="button" id="confirm_button"> it will work with on button only.Thanks

Share this post


Link to post
Share on other sites

where is your code

Share this post


Link to post
Share on other sites

Extending the example on this page: http://www.w3schools.com/js/js_popup.asp You could use

<html> <head> <script type="text/javascript"> function show_confirm(url) { var r=confirm("Are you sure you want to delete?\n\n" + url); if (r==true)   {	 document.location = url;   } else   {	 alert("You pressed Cancel!");   } } </script> </head> <body><a href="javascript:void(0)"  onclick="show_confirm('test.php?action=del&id=1')">Delete 1</a><a href="javascript:void(0)"  onclick="show_confirm('test.php?action=del&id=2')">Delete 2</a> </body> </html>

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...