Hello,
I want to create a confirmation dialog window that will confirm or canel and action triggered by a "click on link" but im not too familiar with javascript and how this works ca somone show me an example
the link when clicked redirects the user to reload the page however i want to have a confirm window that can either stop or proceed the process...can this be done? did i explain myself clear?
Kendall
Confirmation Window
Moderator: General Moderators
just like this
THis code in your head tag
Then you link
Mark
THis code in your head tag
Code: Select all
<script language="JavaScript">
function confirm() {
if(confirm("Are you sure you want to do that?")) {
document.location="some_other.php";
}
}
</script>Then you link
Code: Select all
<a href="javascript:confirm();">Confirm</a>Bech's right, but if you do it this way you don't have to have the URL in your javascript function, which is a good thing:
Code: Select all
<a href="thispage.html" onclick="confirmation()">click</a>
function confirmation()
{
if(confirm("Are you sure you want to do that?"))
{
return true;
}
else
{
return false;
}
}