473,395 Members | 1,681 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

display pictures before upload not working in ie9

Working in Chrome, Firefox.


Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <title>ThaiCreate.Com Tutorial</title>
  4.   <script src="http://code.jquery.com/jquery-latest.js"></script>
  5. </head>
  6. <body>
  7. <form name="frmMain" action="" method="post">
  8. <script language="JavaScript">
  9.     function showPreview(ele)
  10.     {
  11.             $('#imgAvatar').attr('src', ele.value); // for IE
  12.             if (ele.files && ele.files[0]) {
  13.  
  14.                 var reader = new FileReader();
  15.  
  16.                 reader.onload = function (e) {
  17.                     $('#imgAvatar').attr('src', e.target.result);
  18.                 }
  19.  
  20.                 reader.readAsDataURL(ele.files[0]);
  21.             }
  22.     }
  23. </script>
  24. <input type="file" name="filUpload" id="filUpload" OnChange="showPreview(this)">
  25. <input type="submit" name="btnSubmit" value="Submit">
  26. <hr>
  27. <img id="imgAvatar">
  28. </form>
  29. </body>
  30. </html>
  31.  
Attached Images
File Type: png no image.png (1.7 KB, 199 views)
Oct 8 '12 #1
1 3487
Atli
5,058 Expert 4TB
IE9 is not capable of this feature. It doesn't support the FileReader API, nor will it allow you to load stuff of the hard drive using a local file path. (That could easily become a security nightmare.)
Oct 18 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: bborden | last post by:
Novice Access programmer here. I would like to display an image using the Toolbox Image object by calling the images file name using: =fPictureFiles(!!,1) in the Picture control. Below...
5
by: TomB | last post by:
I came up with this idea to show the larger picture of a thumbnail by hiding it with css and "unhide" it when one hovers over the thumbnail. I think it looks pretty nifty, but the problem with this...
0
by: George Race | last post by:
I am trying to display pictures in either ReportViewer or Crystal Reports, using VB 2005. I have the path to pictures in a Form text box that is linked to the database containing the full path to...
2
by: walt | last post by:
Just converted from Office 2000 to Office 2007, after ran into to a few problems (lack of understand being the bigs problem) but the one I can't overcome is, in access 2000 forms I could display ...
33
by: buss123 | last post by:
Hi all, combo box script code was working in IE perfectly with all modes but OnChange event was not working in FireFox(editable mode, if we select valuese that combo box values r...
5
Fary4u
by: Fary4u | last post by:
Hi i'm trying to display picture using if condition but QUESTION if there is no picture then don't bring empty picture ? <html><head><title>New Page 1</title></head><body> <% strImage...
2
by: smorrison64 | last post by:
I have a form that is coded to open a File Dialog boc to pick a picture to display on that particular item on a subform. My form is not based on query, but rather two separate tables (one primary,...
3
by: Ian | last post by:
I have a form with a sub form, on the continues sub for I want to display some data along with a picture, on the On Current event I have the code: .Picture = Nz() is the name of the picture...
3
by: =?Utf-8?B?a2FyaW0=?= | last post by:
Hello all, Is there a simple cod in vb 2008 to find a folder on a network and open a picture from that folder inside the form? thanks for any of your help.
1
by: joeblogs | last post by:
<table> <tr> <td style="display:block">Cell 1</td> <td style="display:block">Cell 2</td> </tr> </table> The above HTML displays the following in Fire Fox Cell 1
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.