Skip to main content
Nintex Community Menu Bar
Solved

Javascript click attachment control to download

  • March 21, 2019
  • 2 replies
  • 174 views
  • Translate

Has anyone ever tried to click an attachment control in the background?
I'm finding it very difficult. Normally, if it was just a button, a simple jquery that looks like this would do the trick: 

$('[name="ButtonName"]').click();

however, apparently the File control isn't just a button, it's DIV with a table, rows, a label. I've tried making Javascript click all sorts of elements within the file attachment control but it doesn't seem to trigger the file download.
I have attached the screenshot that shows what a file attachment control is made up of.
If anyone has any ideas I'd love to hear them, thank you!!


11597iB19567D1D58F5B47.png

Best answer by Albarghouthy

Hi,

Please see this:
https://help.k2.com/support-services/kbt154698
View original
Did this topic help you find an answer to your question?

2 replies

Albarghouthy
Forum|alt.badge.img+16
  • Scholar
  • 741 replies
  • Answer
  • March 21, 2019

Thank you for that,
It was very useful. It does bear note that I had to use the following 

<script type="text/javascript">$('label[class="file-label"]').first().click();</script>

This was to prevent every file attachment control from being clicked.

Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings