Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reference object name in variable 1

Status
Not open for further replies.

eseabrook2008

Technical User
Jan 9, 2008
74
CA
First off, I'm using JavaScript from within Adobe LiveCycle Designer (if that makes any difference).

I'm trying to assign a value to an object (txtbox) by referencing the txtbox name which is stored in a variable.

Here's how it works...

math.value= xfa.form.form1.rb.rawValue; --> a radio button is selected assigning a number to the variable math

test.value=("Live" + math.value) --> the word Live and the value in math are concatenated together in the variable test

There are objects on my form with the name Live1, Live2 and Live3. If radiobutton 1 is select, a value is entered into the object called Live1, if rb2 is select, the object called Live2 is filled, etc...

I've tried this...
xfa.form.form1.(varobj.value)=test.value; --> the error says invalid assigment left-hand side

and...
xfa.form.form1.("Live" + math.value).rawvalue = test.value; --> the error says XML filtering predicate operator called on incomplete XFAObject

Ideas?
 
You may try xfa.resolveNode() method to reference to the textbox, like this.
[tt] xfa.resolveNode("xfa.form.form1."+test.value)[/tt]
 
Thanks tsuji!

I was able to assign a value to the field with:

xfa.resolveNode("xfa.form.form1."+test.value).rawValue = math.value;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top