Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in photo upload in IE7 and mozilla by using javacsript

 
manohar penumarthi
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
function uploadForm()
{
document.forms[0].cmpLogo.value = document.forms[0].companyLogo.value;
if (fileTypeCheck() == false)
{
return false;
}
document.forms[0].compLogo.src = document.forms[0].companyLogo.value;
}

function fileTypeCheck()
{
var reOkFiles=/\.(jpg|JPG|jpeg|JPEG|gif|GIF)$/i;
if(document.forms[0].companyLogo.value != "")
{
var fileStr =document.forms[0].companyLogo.value;
if(!reOkFiles.test(fileStr))
{
alert("Please upload only jpg, jpeg or gif file formates");
return false;
}
}
}
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64830
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can not set an image to the source of a local image file.

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic