Hi Jorge,
Your approach for retrieving the caption for the field is
correct, but there very minute mistakes that would have caused the
problem. let us consider that combo box is referred as DropDownList
and text field as TextField
so the code goes as here..... the three lines of code would work
independently......
if(DropDownList.rawValue == "1")
{
TextField.caption.value.text.value = "Value1";
//or
this.parent.resolveNode("TextField.caption.value.#text").value =
"Value1";
//or
TextField.resolveNode("TextField.caption.value.#text").value =
"Value1";
}
if(DropDownList.rawValue == "2")
{
TextField.caption.value.text.value = "Value2";
//or
this.parent.resolveNode("TextField.caption.value.#text").value =
"Value2";
//or
TextField.resolveNode("TextField.caption.value.#text").value =
"Value2";
}
Don forget to save the form as Dynamic PDF... this is very important
as you are changing the dynamism of the form.
Also its always better to write scripts for a combo box in its "exit"
event or "change" event as per ur requirements.. because "validate"
event is meant mainly for pattern/field validations. thus it would get
executed twice - during the field validation and also if the form gets
submitted to workflow... Hope i made myself clear... feel free to
question for any further doubts...
Would also like to note... Numerous pdf docs are available in adobe
website for download - provides lots of sample scripts and rules for
scipritng in both javascript and formcalc. Do try them and u would
feel scripting is very easy....
Ramya...