I tried this, Its not working.
I want to do following things:
While clicking on submit button the profilePic should be validate. profilePic must not be null and it must accept only one of the
gif|png|jpg|jpeg|pjpeg
file.
I also want to add maximum size for uploading.
$("#basicprofile").bind("submit", function() {
$("#profilePic").validate({
rules: {
field: {
required: true,
accept: "gif|png|jpg|jpeg|pjpeg"
}
}
});
});
<s:form action="basicprofile" method="post" enctype="multipart/form-data"
id="basicprofile">
<s:file name="profilePic" id="profilePic" label="Profile Picture" />
<s:submit />
</s:form>