Discussion:
IE7
(too old to reply)
Zeenat
2010-01-29 09:23:01 UTC
Permalink
I have a simple html page that goes like this

<html>
<head>
<script language="javascript">
function changeImage()
{
if(document.getElementById("changeimage").value!="")
{
document.getElementById("pict1").src=document.getElementById("changeimage").value;
}
}
</script>
<title>Change Image</title>
</head>
<body>
<img name="pict1" id="pict1" src="images/myimage.jpg" height="150"
width="150" /><br />
<input type="file" name="changeimage" id="changeimage"
onblur="changeImage()" />
</body>
</html>

This was working fine in IE6, but is not working in IE7 or IE8.
Can I get some help on this please.
rob^_^
2010-01-29 10:12:13 UTC
Permalink
Try removing the

name="changeimage"

You are using the same tokens for the Id and name attributes. getElementById
is the preferred method.

Regards.
Post by Zeenat
I have a simple html page that goes like this
<html>
<head>
<script language="javascript">
function changeImage()
{
if(document.getElementById("changeimage").value!="")
{
document.getElementById("pict1").src=document.getElementById("changeimage").value;
}
}
</script>
<title>Change Image</title>
</head>
<body>
<img name="pict1" id="pict1" src="images/myimage.jpg" height="150"
width="150" /><br />
<input type="file" name="changeimage" id="changeimage"
onblur="changeImage()" />
</body>
</html>
This was working fine in IE6, but is not working in IE7 or IE8.
Can I get some help on this please.
Loading...