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

Question

Question

Check if upload field has file uploaded in forms

asked on August 28, 2019

Can I check in an exclusive gateway in Forms as to if an upload field in the form has a file uploaded please?

 

Thanks

Priya

1 0

Replies

replied on October 8, 2019 Show version history

Okay, so here is how you do it.

  1. Create a number field that you will make hidden or put inside an already hidden section. This will be the field that will be filled with the number of files that are uploaded.
  2. Call this whatever you want and give it a descriptive class name (I have given it a class name of "checkUpload" in my code example below).
  3. Make sure your upload field also has a unique class (In the example below I have simply called it "upload").
  4. Add the following JavaScript:
    $(function() {
    	$("form").submit( function() {
    		$(".checkUpload [vo]").val( $(".upload tr.file").length );
    	});
    });
  5. Now in your process modeller you simply need to check if the number is zero of your check upload field and bam, decisions can be made.
1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.