Monday, 15 July 2013

Preview Image in File Upload with Java Script and html.


code  for  Preview Image in File Upload with Java Script and html.

<html>
<head>
<title>Preview Image in File Upload  with Java Script</title>
<!--code  for  Preview Image in File Upload  in Java Script.......-->
<script type="text/javascript" language="javascript">

function ImagePreview() {
OfReader = new FileReader();
OfReader.readAsDataURL(document.getElementById("uploadImage").files[0]);

OfReader.onload = function (oFREvent) {
document.getElementById("uploadPreview").src = oFREvent.target.result;
};
};
</script>
</head>

<body>
<table width="100%">
<tr><td>Name</td><td><input type="text" id="name" name="name"></td></tr>
<tr><td>User Image</td><td>
<input type="file" id="uploadImage" name="myPhoto" onchange="ImagePreview();" />
</td></tr>
<tr><td></td><td> <Image id="uploadPreview"   style="width: 75px; height:75px;" /></td></tr>
</table>
</body>
</html>

1 comments:

  1. nice very conceptual blogs
    it's solve my all the problems

    ReplyDelete