I want to remove the error message when choosing a wrong type of file. I followed the link http://forum.primefaces.org/viewtopic.php?f=3&t=23853 .
<p:fileUpload fileUploadListener="#{userProfileUpdateController.upload}"
widgetVar="fileuplaodWgt"
allowTypes="/(\.|\/)(gif|jpe?g|png)$/"
description="Select Images"
update="userPhoto"
mode="advanced"/>
and I import <h:outputScript name="library.js" library="script"></h:outputScript>
In library.js
$(document).ready(function(){
alert(fileuplaodWgt);
fileuplaodWgt.buttonBar.find("button.cancel").bind("click", function(e){
clearInvalidFileMsg();
});
});
function clearInvalidFileMsg(){
fileuplaodWgt.uploadContent.find("tr.ui-state-error").remove();
}
After writing above, file upload is not shown in my page. When I trace the my library.js file, I found fileuplaodWgt ReferenceError: fileuplaodWgt is not defined. I tried in mozilla and chrome. None of them shows my file upload. Can you help me what I am wrong???