
Untitled
By: a guest on
Jun 20th, 2012 | syntax:
None | size: 0.81 KB | hits: 11 | expires: Never
getting the file input value in jquery
<div class="divClass" id="FirstAd">
<h4 align="center">
Advertisement 1</h4>
<div style="float: left; width:25%">
<img src="images.jpg" id="replaceMe" width="100px" height="130px" /></div>
<div style="float: right; width:70%; left:30%">
<input type="text" style="width: 197px" /><br />
<br />
<textarea class="AdContent"></textarea><br />
<br />
<input type="file" id="myImage" size="30" onchange="pictureUpload()" /><br />
<input type="button" value="Preview!"/><br/>
</div>
</div>
function pictureUpload() {
$(document).ready(function() {
var imagepath = "file:\" + $("#myImage").val();
$("#replaceMe").attr("src", imagepath);
alert(imagepath);
});
}