U have this in the HEAD section of my web page:
Now I have this for my drop down menu:
So bascially when someone clicks on Delete Folder, I want the JavaScript to confirm the action. It kind of works. What I mean by that is if I click on Delete Folder, at the same time, it displays the popup and redirects me to the link.
Can someone please help me correct this problem?
Thank you.
-CALV1N
Code:
<!--
function confirmation() {
var answer = confirm("Are you sure you want to delete this folder?")
if (answer){
alert("Bye bye!")
window.location = "[URL unfurl="true"]http://www.google.com/";[/URL]
}
else{
alert("Thanks for sticking around!")
}
}
//-->
</script>
Now I have this for my drop down menu:
Code:
echo "<form name=\"$formname\">";
echo "<td class=\"row\">";
echo "<br><select name=\"dropdown\" onChange=\"location=document.$formname.dropdown.options[document.$formname.dropdown.selectedIndex].value;\" value=\"GO\">";
echo "<option selected>-------------------</option>";
echo "<option value=\"cp.php?action=browse&path=$line\">Browse</option>";
echo "<option value=\"cp.php?action=add&path=$line\">Add Folder</option>";
echo "<option value=\"cp.php?action=rename&path=$line\">Change Name</option>";
echo "<option value=\"cp.php?action=upload&path=$line\">Upload</option>";
echo "<option value=\"cp.php?action=delete&path=$line\" onclick=\"confirmation()\">Delete Folder</option>";
echo "</select>";
echo "</td>";
echo "</form>";
So bascially when someone clicks on Delete Folder, I want the JavaScript to confirm the action. It kind of works. What I mean by that is if I click on Delete Folder, at the same time, it displays the popup and redirects me to the link.
Can someone please help me correct this problem?
Thank you.
-CALV1N