I need some help to make the following statement work in JavaScript event in LC Designer 7.1. The same statement works well if executed as FormCalc function. I need to replace "1" with some expression. I am having trouble executing "Eval" in JavaScript.
Thank you chris. I learned a new point. The statement works with the change you made. However it did not resolve my issue. Here is the part of code I have trouble with.
The message gives me the right syntax(as commented), however TextDescription (TextField) is still non editable. The text field and the button are on the same detail line. And when user clicks Button (Edit button) the text field needs to be editable. Have any suggestions.
The problem is the '[' and ']' in the expression you are trying to eval(). Those are illegal characters in a JavaScript expression. As an alternative I would suggest using script like this on the button:
Chris, Finally I understood I am make round trip approach. Thank you for you line of code it works. However following line of code in FormClac works with no problem where as it do not work in Java script. And I feel like I am missing some thing with your statement "[" and "]". If I recall correctly the similar syntax works in HTML.
Ok, bad choice of words, they aren't illegal, but they are defined in the JavaScript spec as punctuators. In this case you are trying to use them as a notational element to access a specific node in an XFA DOM, which is not how it's intended to be used. Since the JavaScript Interpreter has no idea of these things it doesn't like it.
It works in FormCalc because it is a scripting language designed by us specifically for working with an XFA DOM.