Webboy2008
asked on
jquery, upload
I have generic web form in asp.net, just like contact information with name, address...and etc.
I would like to add upload button to allow user to upload document. How can I validate to make the attachment is there in jquery?
Thanks
I would like to add upload button to allow user to upload document. How can I validate to make the attachment is there in jquery?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ah, looks like you are using a validation plugin - without knowing which one can't test but would imaging it would be something like this.
Also don't know the id of your file upload control so you need to change that
Also don't know the id of your file upload control so you need to change that
<script type="text/javascript">
$(document).ready(function() {
$("#aspnetForm").validate({
rules: {
<%=txtschool.UniqueID %>: {
required: true
},
<%=txtschoolclass.UniqueID %>: {
required: true
},
<%=txtmajor.UniqueID %>: {
required: true
},
<%=txtprofessor.UniqueID %>: {
required: true
},
<%=txttextbook.UniqueID %>: {
required: true
},
<%=txtschoolyear.UniqueID %>: {
required: true
},
<%=txtschoolyear.UniqueID %>: {
required: true
},
<%=txttotalpagenumber.UniqueID %>: {
required: true
},
<%=YOURFILEUPLOADBOXID %>: {
required: true
},
}, messages:
{
}
});
});
</script>
ASKER
The code is working fine.
ASKER
<script type="text/javascript">
$(document).ready(function
$("#aspnetForm").validate(
rules: {
<%=txtschool.UniqueID %>: {
required: true
},
<%=txtschoolclass.UniqueID
required: true
},
<%=txtmajor.UniqueID %>: {
required: true
},
<%=txtprofessor.UniqueID %>: {
required: true
},
<%=txttextbook.UniqueID %>: {
required: true
},
<%=txtschoolyear.UniqueID %>: {
required: true
},
<%=txtschoolyear.UniqueID %>: {
required: true
},
<%=txttotalpagenumber.Uniq
required: true
},
}, messages:
{
}
});
});
</script>