J
Joe
I'm trying to create an image preview function so that my users can
preview images before they upload them. I've got my example working
locally on both Firefox and IE, and from the webserver in IE. However,
when I try to access the example via a webserver and Firefox, it
doesn't work. Any help with this would be greatly appreciated.
(Code listed below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script language=Javascript>
<!--
function previewImage()
{
var previewImage = document.f.colortheme.value;
var spaceMatch = / /gi;
var slashMatch = /\\/gi;
previewImage = previewImage.replace(spaceMatch, "%20");
previewImage = previewImage.replace(slashMatch, "/");
previewImage = "file:///" + previewImage;
document.getElementById('PREVIEW').src = previewImage;
return false;
}
//-->
</script>
<html>
<head>
<title>PREVIEW-IMAGE (UPDATED-1123)</title>
</head>
<body>
<h5>PREVIEW IMAGE onChange</h5>
<table border="1" bgcolor="gold">
<tr>
<td>
<form method="post" name="f" id="f"
action="form_dropdown_image_select_rmk_UNIVERSAL.html">
<!--
visit our website: http://www.angdatingdaan.org --- really cool
email me: (e-mail address removed)
-->
Select image:<br>
<input type="file" name="picture" maxlength="1024" value=""
onchange="previewImage()" id="colortheme">
</center>
</form>
</td>
<td valign="center" width="300" align="center"><img
src="http://images.animationfactory.com/...ts/mouse_quiet_shh/mouse_quiet_shh_sm_nwm.gif"
border="0" id="PREVIEW" alt="preview image"/></td>
</tr>
</table>
</body>
</html>
preview images before they upload them. I've got my example working
locally on both Firefox and IE, and from the webserver in IE. However,
when I try to access the example via a webserver and Firefox, it
doesn't work. Any help with this would be greatly appreciated.
(Code listed below
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<script language=Javascript>
<!--
function previewImage()
{
var previewImage = document.f.colortheme.value;
var spaceMatch = / /gi;
var slashMatch = /\\/gi;
previewImage = previewImage.replace(spaceMatch, "%20");
previewImage = previewImage.replace(slashMatch, "/");
previewImage = "file:///" + previewImage;
document.getElementById('PREVIEW').src = previewImage;
return false;
}
//-->
</script>
<html>
<head>
<title>PREVIEW-IMAGE (UPDATED-1123)</title>
</head>
<body>
<h5>PREVIEW IMAGE onChange</h5>
<table border="1" bgcolor="gold">
<tr>
<td>
<form method="post" name="f" id="f"
action="form_dropdown_image_select_rmk_UNIVERSAL.html">
<!--
visit our website: http://www.angdatingdaan.org --- really cool
email me: (e-mail address removed)
-->
Select image:<br>
<input type="file" name="picture" maxlength="1024" value=""
onchange="previewImage()" id="colortheme">
</center>
</form>
</td>
<td valign="center" width="300" align="center"><img
src="http://images.animationfactory.com/...ts/mouse_quiet_shh/mouse_quiet_shh_sm_nwm.gif"
border="0" id="PREVIEW" alt="preview image"/></td>
</tr>
</table>
</body>
</html>