View Full Version : Alert with a password...

Jul 22nd, 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?

Jul 22nd, 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.

Jul 23rd, 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)?