alert onclick
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
alert onclick
this is easy but i am the worst at javascript. i want when you click on a link that it will alert saying "you sure you want to delete $variable_name" where variable name is the name of a hidden field. then if they click yes it continues with what it would do but if they click no then it stops and does not go to the link.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Code: Select all
<script type="text/javascript">
<!--
function askOK()
{
if (confirm('Dude! You sure you are OK with this??!')) return true;
else return false;
}
// -->
</script>
<a href="somewhere_bad" onclick="return askOK();">Click me</a>- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact: