Yes, trust me I tried for hours, that's where I got my code to begin since I don't know anything about <form>. I think it has something to do with that page.
Like for example I put this piece of code in a blank php file:
PHP Code:
<html>
<head>
<script type="text/javascript">
function show_confirm()
{
var r=confirm("Press a button");
if (r==true)
{
document.write("You pressed OK!");
}
else
{
document.write("You pressed Cancel!");
}
}
</script>
</head>
<body>
<input type="button" onclick="show_confirm()" value="Show confirm box" />
</body>
</html>
When I click the button, it gives a cofirmation pop-up and works like it should.
However, when I put that code in my template, when I click the button, it automatically directs me to a page with the false "You pressed Cancel!" text. I think something is interfering with it?