Expand my Community achievements bar.

How to block an object (visible but inactive)?

Avatar

Level 1

I have a fillable form with objects like radio buttons, check boxes, and text fields. When user selects a choice by clicking on a radio button, I want some of the objects, like all radio buttons in the radio button group, still visible but not selectable. I tried the following but it does not work as expected:

// form1.page1.showControlButton.hide::click - (JavaScript, client)

....

page1.optionButton.presence = "inactive";

page1.optionButton.b1.presence = "inactive";

page1.optionButton.b2.presence = "inactive";

page1.optionButton.b2.presence = "inactive";

This is my first time using the feature (visible/hidden/inactive) in LiveCycle designer. I can hide them but can't block them. Can anybody help me?

Thanks

Sam

4 Replies

Avatar

Level 10

Use the access property to make objects read only.

page1.optionButton.b2.access = "readOnly";

Avatar

Level 4

First off hello Sam and welcome to the Livecycle club!

What you are looking for is readOnly; not inactive. I put a code snippet from the Action Builder below. I might suggest that if you are like me and your coding skills are somewhat limited (at best for me), I would suggest the Action Builder. If you are using Windows go to the toolbar at the top, go to Tools and then select Action Builder. This is a great resource for those of us with limited coding skills and it provides a template for some pre built actions. All I did was select a condition (something like if CheckBox 1 is checked) then on the result select "enable or disable object" and select the object you wish to disable. You can add multiple checks like if a series of boxes is checked or if a field is not null and you can disable or enable a set of fields. It is even helpful for understanding code because in the Script box it shows you what the code looks like and you can always tweek it for more or it can help you with understanding scripts.

if ((this.resolveNode("$").rawValue != null && this.resolveNode("$").rawValue != "")) {

  oTargetField = this.resolveNode("CheckBox1");

            oTargetField.access = "readOnly";

}

Avatar

Level 1

Yes. This is what I want.

Thanks so much!

Avatar

Level 1

Hi Josh,

This is even more helpful. I am just new to the LiveCycle. The Action Builder is a great tool for me to start with. Following your insturction, I figured out how to toggle it back: 

e..g.     oTargetField.access = "open";

Really appreciate your help.

Thanks

Sam