• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Tim Cooke
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
  • Piet Souris
Bartenders:
  • Stephan van Hulst

problem in photo upload in IE7 and mozilla by using javacsript

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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;
}
}
}
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not set an image to the source of a local image file.

Eric
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic