Dear all,
First time posting. I have a piece of javascript like the following. What it does is when you click on the text 'Click me', it will prompt you for password; if you enter 'test', it will show the url 'picasa' in a div. The code works in FF3 perfectly but it just won't show the url in IE7. Please shed me some light.
<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
var URL = "http://picasaweb.google.ca/";
var form = "<form name=\"gform\"" + "method=\"post\">" +
"Password: <input type=\"password\" name=\"gpassword\" id=\"gp\"/>" +
"<input type=\"submit\" onclick=\"validate()\" value=\"submit\" />" +
"</form>";
var pass = "test";
function setFocus()
{
document.getElementById("gp").focus();
}
function showURL()
{
document.getElementById('GalleryDiv').innerHTML = "<a href=\"" + URL + ">" + "LINK" + "</a>";
}
function showForm()
{
document.getElementById('targetDiv').innerHTML = form;
}
function validate()
{
if(document.getElementById("gp").value==pass)
{
showForm();
showURL();
}
} //end validate()
</SCRIPT>
</head>
<body onload="setFocus()">
<h1 onclick="showForm();setFocus();">Click me</h1>
<div id="targetDiv">
</div>
<div id="GalleryDiv">
</div>
</body>
</html>