aspose file tools
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply 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: 56218
    
  13

And?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Eric Pascarello
author
Rancher

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

Eric
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: problem in photo upload in IE7 and mozilla by using javacsript
 
Similar Threads
Ajax javascript not recieving responseText from Struts
Struts 1
How to get Image from request
Help needed with IE 6.0 submit
ajax file upload and javascript