You are viewing limited content. For full access, please sign in.

Question

Question

As I can see if a file was uploaded from javascript?

asked on March 6, 2015

as I can to know if a "File Upload" contains a file, is for an if statement in javascirpt

0 0

Replies

replied on March 6, 2015 Show version history

Hi Esteban,

 

I'm not sure I understand exactly what's going on here but if you wanted to get the total number of files attached to a form you can use this jQuery to return the result as an integer.

$('A.ellipsis').length

This is counts each instance a link has been provided to a file by Laserfiche Forms which is uniquely assigned the class ellipsis. So if a user attaches 3 files to field #q1, and 2 files to field #q2 then it will return a value of 5.

 

If you want to validate that a file has been attached to a specific field, use this method:

$('#q3 > div > div > table > tbody > tr > td > a.ellipsis').length;

This will return the number of files attached to the Upload File field with the ID Q3. Add this in for each of your ID fields and then compare the results to know if a file has been provided for each field.

1 0
replied on March 6, 2015

yes, it should add an element. I cannot remember at this time what it looks like but if you add a file and inspect the code you should find what you are looking for.

0 0
replied on March 6, 2015

I have 3 fields "File upload" but I need to know when everyone has a file.
how I can do it?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.