L
lawrence
I'm trying to modify a script to work on my site, but I can figure out
how to call it. I've two lines of PHP printing out this bit of a form:
echo "<input type=\"file\" name=\"uploadedFile\">";
echo "<input type=\"hidden\" name=\"uploadType\" value=\"image\"
onchange=\"DoPreview();\">";
This function is listed above the form. is onchange() the correct
trigger?
<script language="javascript">
function DoPreview()
{
var filename = document.forms[0].inputId1.value;
var Img = new Image();
if (navigator.appName == "Netscape")
{
alert("Previews do not work in Netscape.");
}
else
{
Img.src = filename;
ppImg = Img.src;
alert("You're loading image" + ppImg);
document.images[0].src = Img.src;
}
}
</script>
how to call it. I've two lines of PHP printing out this bit of a form:
echo "<input type=\"file\" name=\"uploadedFile\">";
echo "<input type=\"hidden\" name=\"uploadType\" value=\"image\"
onchange=\"DoPreview();\">";
This function is listed above the form. is onchange() the correct
trigger?
<script language="javascript">
function DoPreview()
{
var filename = document.forms[0].inputId1.value;
var Img = new Image();
if (navigator.appName == "Netscape")
{
alert("Previews do not work in Netscape.");
}
else
{
Img.src = filename;
ppImg = Img.src;
alert("You're loading image" + ppImg);
document.images[0].src = Img.src;
}
}
</script>