View Full Version : Alert with a password...

07-22-2005, 11:31 PM
I have:

onclick='if(confirm("Are you sure you want to delete this record?")){ window.location="delete.php?id=<?=$row['id']?>";}'
But what I would LIKE to have happen is instead of just an 'ok' 'cancel' prompt, get a password prompt that asks for a password to delete the record. Is this doable?

07-22-2005, 11:46 PM
nevermind. i got it...

function deletequote() {
var password = "";
password=prompt("Enter password please. - ", "");
if (password == "acigp") {
location.href= "delete.php?id=<?=$row['id']?>" }

else {
alert("Wrong Password") };
</script><input onclick="deletequote();" type="button" value="X" class="sbttn3">
I would have deleted this thread but I don't know how.

07-23-2005, 12:04 AM
Ok, I know it's easy to just view the source and see the code but this is an internal deal with a bunch of idiots using it, BUT...is there a way to hide this? Is there a way to put it within PHP tags (i tried unsuccessfully)?