javascript - How can I implement a confirmation dialog for critical action? -
I'm not proficient in JS myself, so maybe I will take a few hours to find out, so I thought I will ask people to you
I have removed / removed links on my site, which are used by the administrator to moderate users and what they post. Since these links have such strong results on the content of the site, I would like to confirm some kind of link, which is a popup on a click of the link.
Some additional text should be understood what is going to happen, and the OK / Cancel button
then I have a link, for example:
< Pre> & lt; A href = "ban.php? Id = 123" class = "confirm_ban" & gt; Ban John & lt; / A & gt; & Lt; A href = "delete.php? Id = 123" class = "confirm_delete" & gt; Delete post & lt; / A & gt;
When this link is clicked, the code should be triggered. If OK is pressed, then ban.php? Id = 123, if the cancellation is pressed, it does not go anywhere
A simple JS dialog box will do this. Or if you have a link for fancy jquery powered box, you can talk to me at that too.
Thank you!
The easiest way to get it confirmation ()
function:
var is using confirmation = confirmation ('do you really want to do this?'); If (Confirmed) {// Dangerous Action}
This displays a box with the text you provided and is OK and cancels the button.
With a link you can do something like this:
& lt; A href = "someurl" onclick = "Confirm Return ('Are You Sure?');
This is the best possible practice to take action on the auction It does not work, but it works and it is easy to understand that you are not a pro Java
Comments
Post a Comment