Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 20th, 2012  |  syntax: None  |  size: 0.81 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. getting the file input value in jquery
  2. <div class="divClass" id="FirstAd">
  3. <h4 align="center">
  4.         Advertisement 1</h4>
  5.     <div style="float: left; width:25%">
  6.         <img src="images.jpg" id="replaceMe" width="100px" height="130px" /></div>
  7.     <div style="float: right; width:70%; left:30%">
  8.         <input type="text" style="width: 197px" /><br />
  9.         <br />
  10.         <textarea class="AdContent"></textarea><br />
  11.         <br />
  12.         <input type="file" id="myImage" size="30" onchange="pictureUpload()" /><br />
  13.         <input type="button" value="Preview!"/><br/>
  14.     </div>
  15. </div>
  16.        
  17. function pictureUpload() {
  18.         $(document).ready(function() {
  19.             var imagepath = "file:\" + $("#myImage").val();
  20.             $("#replaceMe").attr("src", imagepath);
  21.             alert(imagepath);
  22.         });
  23.     }