I want to get preview of an image before uploading it in a form which have other field like name,age etc. i have tried the ajax solution. the code works fine standalone. But When i put the code into the form it does not work.plz help me.
the code is as follow: standalone code for image preview through Ajax
<form id="imageform" method="post" enctype="multipart/form-data" action='ajaximage.php'>
Upload your image <input type="file" name="photoimg" id="photoimg" />
</form>
and my form is
<form name="iupload" action="index.php" method="post" >
Name <input type="text" name="myname" ><br/>
Age <input type="text" name="age" >
<input type="file" name="photoimg" id="photoimg" />
<input type="submit" name="submit" value="upload">
<div id='preview'>
</div>
</form>