These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Changing the value of a Text Field but it wont stick

alisam
Registered: Nov 17 2007
Posts: 7

This message was posted in the Adobe LiveCycle ES Forum but as yet I have not had a reply. If my example/problem is not clear then please tell me.

Entering the event, tf_Company = " Integral" and the 'if' statement will change the value to " TBA" (and it can be clearly seen on the screen).
However, after the 'if' statement the value of tf_Company is now null and I don't know why.

dd_Type is in a subform.

// At this point tf_Company is " Integral"
xfa.host.messageBox("tf_Company: " + tf_Company.rawValue, "Debugging", 3);

// The if statement executes as true
if (dd_Type.rawValue == "M" && tf_Company.rawValue == " Integral")
{
tf_Company.rawValue = " TBA";
// At this point " TBA" displays in the form
xfa.host.messageBox("Company has been changed to 'TBA'", "Company",3,0);
};

// At this point tf_Company is null - Why???
xfa.host.messageBox("tf_Company: " + tf_Company.rawValue, "Debugging", 3);

DanielKunz
Registered: Jan 22 2008
Posts: 55
Try one of this codes:
1) instead of "dd_Type.rawValue" write "xfa.event.newText" (if your event is in dd_Type)
2) instaed of "dd_Type.rawValue" write "dd_Type.value.text.value"

One of that variants should work. If not, write to me.

explanation:
Your code "dd_Type.rawValue" returns the previous value of dd_Type, also NULL and not the actual value.

Greets
Daniel
alisam
Registered: Nov 17 2007
Posts: 7
I have solved my problem.

I made a new (simple) form and everything worked as expected.
So I deleted my tf_Company text field in the original form and re-added it. Again, my tests worked. So somehow, deleting the object and re-adding it made it work.

Thank you Daniel for your suggestions.