I change this:
var file = $(this).next().find('.textbox-value');
for this:
var file = $('#anexo').next().find('.textbox-value');
$.extend($.fn.validatebox.defaults.rules, {
maxSize: {
validator: function(value,param){
var file = $('#anexo').next().find('.textbox-value');
sizeKB = ((file[0].files[0].size)/1024).toFixed(0);
if(sizeKB > 999){ return false; }
},
message: 'The file must be 999 KB maximun.'
}
});
and its ok, it works
but how can I do it dynamic??
second:
I add a file of 425 KB and I get the maximun size error message
if(sizeKB > 999){ alert(sizeKB); return false; }
but 425 not is greater than 999 !!!