[BUG] Fileupload element + Ajax validation + Toggle Submit

Mustafa_s

Member
Hi All,

Using the latest Joomla + Fabrik, I think I may have spotted a bug, here are the steps to take in order to reproduce the bug.

1) Create a few misc elements with validations (doesn't matter what the validations are, NOTEMPTY for example).
2) Create a Fileupload element with file limit set to 2MB (it can be any number), without using ajax uploads. NO VALIDATIONS set.
3) Ensure Form has Ajax validation + Toggle submit options set (so as to ensure every field is entered).
4) Submit a new record with a file that is 3MB (larger than the set limit of 2MB).

What happens is the form fails with an error, Fabrik displays a warning that the file uploaded is bigger than the limit set, allowing the user to select a different file or no file at all. But whatever the user selects (either to upload a smaller file or no file) the submit button is always disabled.

Can this be looked into please? A similar thread was posted a month or so ago.

Thank you.
 
Last edited:
I don't seem to be able to replicate this.

http://screencast.com/t/L4OphGIwY

(Ignore the PHP warnings after it submits, that's something else I'm working on).

So I have two fields with "not empty", and a non-AJAX upload with a 512M limit, with no validation on it. If I select a file larger than 512M, it fails, gives the warning, the two fields are validated fine, and I can submit again.

Can you point me at the form you are having issues with?

-- hugh
 
Hugh,

That's interesting, looks to be working as expected on your end as designed. Must be something unique to my form then, I'm going to dig deeper.

The my sites user area has the information for the development site hosting the form where I'm experiencing this behaviour. I have the Fileupload elements set to 20BM at the moment, feel free to lower this to a lower value for faster testing.

Edit: This is just as an FYI, while I was testing earlier, I noticed that .ZIP and .JPG files don't respect the file upload size limit, I seem to be able to upload whatever size I want. However, if I upload a .STEP file for example it does respect the file upload size limit and throws the error that the file is too large.
 
Last edited:
I always forget to turn off the firewall, damnit.

You should be able to login now. Sorry.
 
Last edited:
Looked at this again, thinking maybe its a template issue but that's not the case.

Looks like the Submit button remains disabled no matter if I have validation set or not.
 
Looked high and low, could not figure out what was causing the issue. So I opted to using some JavaScript code on my fileupload element to work around the issue (probably a better fix too!)

JavaScript:
var inpFiles = document.getElementById('element');
for (var i = 0; i < inpFiles.files.length; ++i) {
    var size = inpFiles.files.item(i).size;
     
 if(size > 30000000){        
          var size = Math.floor(size/1000000) + 'MB';
          alert("Erreur! La taille du fichier que vous avez s?lectionn? d?passe la limite de 30Mo, s'il vous pla?t s?lectionner un fichier moins volumineux pour continuer. Pour r?f?rence, la taille actuelle du fichier joint est: " + size);
          Fabrik.getBlock('form_3').formElements.get('element').clear();
         
      }else{                 
      }
  }
 
OK. Obviously I can't debug the original problem now, so let me know if you need to revert to the original method.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top