HTML code
<table style= "Border:none" >
<thead>
<tr>
<th class= "Userphoto" > Personnel registration Photo </th>
<th class= "Idcardphoto" > ID photo </th>
</tr>
</thead>
<tbody>
<tr>
<td>
<p class= "Short-input ue-clear" >
<?php if (!isset ($datalist [' Userphoto ')):?>
Name= "Userphoto"/>
<?php Else:?>
Id= "Userphoto" name= "Userphoto"/>
<?php endif;?>
</p>
</td>
<td>
<p class= "Short-input ue-clear" >
<?php if (!isset ($datalist [' Idcardphoto ')):?>
src= "/images/shenfenzheng.jpg"
Id= "Idcardphoto" name= "Idcardphoto"/>
<?php Else:?>
src= "<?php echo $datalist [' Idcardphoto '];?>"
Id= "Idcardphoto" name= "Idcardphoto"/>
<?php endif;?>
</p>
</td>
</tr>
<tr>
<td>
<p class= "Short-input ue-clear" >
<input type= "File" Name= "userphoto1" class= "Default" multiple= ""
onchange= "Preview (This, ' Userphoto ', ' Divuserphoto '); "id=" Userphoto "/>
</p>
</td>
<td>
<p class= "Short-input ue-clear" >
<input type= "File" Name= "idcardphoto1" class= "Default" multiple= ""
onchange= "Preview (This, ' Idcardphoto ', ' Dividcardphoto '); "id=" Idcardphoto "/>
</p>
</td>
</tr>
</tbody>
</table>
JS Code
function Preview (obj, obj1, obj2) {
if (document.all) {//document.all is a collection of all elements within a page that can be used to determine if the browser is IE
$ ("#" + obj1). CSS ("width", "0px");
$ ("#" + obj1). CSS ("height", "0px");
$ ("#" + obj2). CSS ("Display", "block");
Alert ("SD");
document.getElementById (' + Obj2 + '). Filters.item ("DXImageTransform.Microsoft.AlphaImageLoader"). src = Obj.value;
} else {
$ (' # ' + obj1). Show ();
var file = obj, Objecturl =window. Url.createobjecturl(file. files[0]);
$ (' # ' + obj1). attr ("src", objecturl);
}
}
JS implementation in the page upload image browse