Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Unable to set the value of a textbox from Folder-Level javascript

Avatar

Former Community Member

Hello!

I am trying to set the value of a textbox from a Folder-Level javascript but the value does not change on the textbox.

I am able to get the current value but unable to change the value.

This works when I run it from livecycle but not from Folder-Level.

function Test()

{

     var txtResultField = this.getField("form1[0].#subform[0].txtResultField[0]");

     var text = txtResultField.value;

     app.alert(text); //I get the correct current value of the textbox

     txtResultField.value = "abc123"; //Unable to set value here. I also tried with rawValue and valueAsString

     //I also tried to do this.getField("form1[0].#subform[0].txtResultField[0]").value = "abc123"; and it didn't work either.

}

app.addMenuItem({cName:"-", cParent:"Help", cExec:" "});

app.addMenuItem({cName:"Get Field Value", cParent:"Help", cExec:"Test();"});

This is my textbox:

998160_pastedImage_12.png

Any help would be appreciated!

Thank you!

1 Reply