Attachments

Discussions about Forms Designer for SharePoint 2010.
Locked
User avatar
schuess
Posts: 82
Joined: Wed Jan 22, 2014

26 Feb 2014

Is there any way to interact with with attachments field.


For example

can you check if the attachments fields is null?

can you read the file name of the attachment?

can you prevent the attachments from disappearing when someone fails a field requirement?


just wondering.


thanks

matt

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

27 Feb 2014

Yes, you can control the Attachments field via JavaScript.

can you check if the attachments fields is null?
Yes, you can retrieve the attachments table and check whether it contains rows or not via JavaScript

can you read the file name of the attachment?
Yes

can you prevent the attachments from disappearing when someone fails a field requirement?
Unfortunately, not. Files are lost after postback if they were not loaded to the server.

hp
Posts: 26
Joined: Thu Jan 15, 2015

16 Jan 2015

How do you read the attachment file name i am trying to send a link to attachment directly in task. thanks in advance!

User avatar
Dmitry Kozlov
Site Admin
Posts: 1524
Joined: Thu Jun 07, 2012

20 Jan 2015

Please, use the code below:

Code: Select all

//first attachment
var filename1 = $('#idAttachmentsTable tr td.ms-vb').eq(0).text();

//second attachment
var filename2 = $('#idAttachmentsTable tr td.ms-vb').eq(1).text();

hp
Posts: 26
Joined: Thu Jan 15, 2015

14 Sep 2015

Thanks this worked perfectly!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 8 guests