Page 1 of 1
Attachments
Posted: 26 Feb 2014
by schuess
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
Re: Attachments
Posted: 27 Feb 2014
by Dmitry Kozlov
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.
Re: Attachments
Posted: 16 Jan 2015
by hp
How do you read the attachment file name i am trying to send a link to attachment directly in task. thanks in advance!
Re: Attachments
Posted: 20 Jan 2015
by Dmitry Kozlov
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();
Re: Attachments
Posted: 14 Sep 2015
by hp
Thanks this worked perfectly!