Expand my Community achievements bar.

LiveCycle Checkboxes and "Add Attachment" button

Avatar

Level 1

Hello people,

I'm currently working on alot of LiveCycle forms (many are very similar), however there are two things that won't seem to work on any of my forms.

I'm using Adobe LiveCycle Designer ES 8.2.

First:

I have three checkboxes. None should be "on" by default and only one should be able to be selected at a time. Example:

I click checkbox 1, it turns "on".

If I then click checkbox 2 (or 3), the others should be turned "off".

If I then click 1 again, checkbox 2 should be turned "off".

Radiobuttons, and litterary dussins of scripts on checkboxes... What should I do?

Second:

Same here, I've spent days trying to figure this out, but for some reason my Java knowledge is not enough for LiveCycle. (If I even have to use Java?)

I need a button adding an attachment to the form. I then need another button which by default shows "No attachment".

When I add the attachment by clicking the first button, the "no attachment button" should change name into the attachment's name.

Here comes the tricky part: When I click the "No attachment" button (which now is called like "anton whatever.pdf") this should work like a View Attachment button.

Is this even possible?

Any advice or tips is appriciated, and keep in mind that I'm kind of a novice in LiveCycle.

Thanks in advance,

Anton B.

2 Replies

Avatar

Level 10

Hi.

1) To uncheck other checkboxes use the a script like this in the click:Event of each checkbox.

// Uncheck checkbox "CB2" and "CB3"

CB2.value.integer.value = 0;

CB3.value.integer.value = 0;

2) You can call the importDataObject method from every PDF with JavaScript.

In Designer it could look like:

var ID = String(new Date().getTime());

try

     {

     event.target.importDataObject(ID);

     }

catch(e)

     {}

But, this method is generally not available for Adobe Reader users!

Means, only if the form was extended with required rights by LiveCycle Reader Extensions.

Avatar

Level 1

Hey,

Thanks a bunch, first one works like a charm!

The attachmentbutton however. I'm currently using a totally different script (found it online);

      form1.#subform[0].Button1[1]::click - (JavaScript, client)

    

     var AttachmentDescription = this.name;
     AttachmentDescription.rawValue = "New Attachment" + AttachmentDescription.rawValue; 
     var strAttachmentName = AttachmentDescription.rawValue; 
     var myDoc = event.target; 
     myDoc.importDataObject(strAttachmentName); 
     var objDoc = myDoc.getDataObject(strAttachmentName); 
     var FileName = "";
     FileName.rawValue = objDoc.path; 
     //this.presence = "invisible"; 
     AttachmentDescription.access = "protected";

This works perfectly for me, but perhaps it's not compatible with the second button I need?


Btw, I do have LiveCycle Reader Extensions.

Again, thanks, and thanks in advance!

Anton B.