Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Form scripting. please help!

Avatar

Level 1

In my form design I have a sub form which has a checkbox (CheckBox1). When checked (I am able to figure out how this is done) I would like to display the caption text of the checkbox in a TextField in the main form area. The subform will then be hidden.

My problem is how do I access the caption string in LC ES.

Here is how far I have gotten so far:

//var chkBoxText = CheckBox1.parentNode.getElementsByTagName('label');

var boxname = CheckBox1.caption.value;

if (CheckBox1.rawValue == true){

Table1.Row1.TextField1.rawValue

= boxname;

}

else {

Table1.Row1.TextField1.rawValue

= "Dosen't Work";

}

Subform1.presence

= "invisible"

The commented out area is for javascript but dosen't seem to work in LC.

I am New to both Javascript and Livecycle.

Any help would be appreciated.

2 Replies

Avatar

Level 10

The caption of a checkbox can be referenced as follow

The following expression is not a valid conditional check

CheckBox1.rawValue == true

You should use (CheckBox1.rawValue == "true") if the checkbox's on value is true.

Nith

Avatar

Level 1

Nith,

Thankyou. This has saved the few hairs left on my head from being pulled out.

Much appreciated

Kumar