Is there any way to check the image size before submitting the form?
I am using jquery.form
JS:
$(document).ready(function() { var options = { target: '#myform', }; $('#myformbutton').click(function() { $('#myform').ajaxSubmit(options); return false; }); });
HTML:
<form action="myaction" method="post" id="myform" enctype="multipart/form-data"> <label for="id_title">Title</label> <input id="id_title" type="text" name="title" maxlength="255" /> <label for="id_image">Image</label> <input type="file" name="image" id="id_image" /> <input type="button" id="myformbutton" value="Add!" /> </form>
source share