hello all. i've bee learning php for the last couple of weeks while designing a site but i am now frequently running into situations where i need to use javascript. i have a page where i want a user to browse for a pic with a file field and i would like the image to be displated as a preview before the user uploads the pic. i found this script...
function showLocalImage(imgname)
{
imgname = imgname.replace(/\\/g,"/");
imgname = imgname.replace(/\'/g,"\\'");
content = "<img src=\"" + String(imgname) + "\" border=\"0\" height=\"150\" weight=\"150\">";
eval('document.all("imagepreview").innerHTML=\" + content +"'");
document.all.imagepreview.style.visibility ='visible';
}
...but it dosent seem to be working for me, i'm using IE7 by the way. any help would be appreciated. thanks in advance!