Here is a form I created:
<form action="#" enctype="multipart/form-data" method="post" name="..." id="formPhoto" class="fmp">
<input type="file" name="pho" id="photo" class="inph" accept="image/*">
<button type="submit" id="subFormPhoto" class="spp">click here</button>
</form>
Additionally, here is the JavaScript code I used:
<script type="text/javascript">
var inputPhoto= document.getElementById('photo');
inputPhoto.onchange=function(){var photo= this.value; photo.onload=function(){alert(this.width+' '+this.height);};};
</script>
I'm facing an issue where the
alert(this.width+' '+this.height);
is not displaying. It seems like the photo
is not loading properly.