AUI().ready('event','node',function(A){
imgCheck=function(){
alert("Image Checking");
var elem = A.one("#<portlet:namespace/>cover").val();
var parts = elem.split('.');
var imgformat = parts[parts.length - 1];
switch (imgformat.toLowerCase()) {
case 'jpg':
case 'gif':
case 'bmp':
case 'png':
case 'jpeg':
return true;
}
alert("Please Upload Correct Image Format");
A.one("#<portlet:namespace/>cover").val("");
return false
};
});
imgCheck=function(){
alert("Image Checking");
var elem = A.one("#<portlet:namespace/>cover").val();
var parts = elem.split('.');
var imgformat = parts[parts.length - 1];
switch (imgformat.toLowerCase()) {
case 'jpg':
case 'gif':
case 'bmp':
case 'png':
case 'jpeg':
return true;
}
alert("Please Upload Correct Image Format");
A.one("#<portlet:namespace/>cover").val("");
return false
};
});
No comments:
Post a Comment