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

Question

Question

Regular expression for Document Upload button

asked on October 4, 2017

Good morning,

I'm working on a form that will upload PDFs using the Upload button from Forms. I have to check that the file name corresponds with a certain pattern. I didn't find a section for regular expressions for the Upload button so what I'm doing is just creating an additional textbox and then passing the value of the document to the input textbox.

It works, but I just think it looks kind of weird having the input box just for checking. I'm afraid the customer might get confused too. If I hide the box it also works, but id doesn't bring focus to the error, so If I'm at the bottom of the form and submit, the error appears, but since the textbox is hidden, there is no focus back up, so the customer might not know.

Is there a better way to do this? Any ideas/suggestions?

Thank you,

Raul Gonzalez

UploadButton.PNG
0 0

Replies

replied on October 4, 2017 Show version history

Ok, I improved it by catching the error and setting the focus on the Upload button. Let me know if you know of a better way please.

  $(document).on('click', '.Submit', getFIA);
  
	$('.FIA input').hide();
  
  function getFIA() {
    
  var title = $(".somebuttonclass .ellipsis").attr("title");
  
  var getFIA = title.substring(0, 9);
  $('.FIA input').val(getFIA);
    
            if ($('.FIA input').parsley().validate()!= true)
              {

                $('.SupportingDocumentation input').focus();

              }
 
}

 

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

Sign in to reply to this post.