This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes problem in photo upload in IE7 and mozilla by using javacsript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem in photo upload in IE7 and mozilla by using javacsript" Watch "problem in photo upload in IE7 and mozilla by using javacsript" New topic
Author

problem in photo upload in IE7 and mozilla by using javacsript

manohar penumarthi
Greenhorn

Joined: Sep 25, 2008
Posts: 2
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

Joined: Jan 10, 2002
Posts: 63195
    
  69

And?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15385
    
    6
You can not set an image to the source of a local image file.

Eric
 
Have you checked out Aspose?
 
subject: problem in photo upload in IE7 and mozilla by using javacsript
 
It's not a secret anymore!