on 11-11-2008 5:55 AM
Hi All,
Im designing an adobe form in SFP. The following is my scenario.
I have 3 textfields like texfield1,texfiled2,texfield3. and a dropdown box with static values like Vendortype1,2,and3.
Depending on my selection in the dropdown (Vendortype1), 2 fields like textfield1 and 2 should be displayed on form. and textfield3 should be hided
If I select Vendortype2 from dropdown, textfield3 should be displayed.
I tried doing this with javascript for few fields but couldnt.
Can some one tell how to handle this?
I have written in change event of dropdown like following but it is not working.
-
data.#subform[0].DropDownList2::change - (JavaScript, client)----
if(this.value = "Vendortype1" )
{
TextField1.presence = "Visible";
}
else
{
TextField1.presence = "Invisible" ;
}
And also do we have any refence site for scripting in Adobe Life Cycle designer? Do we have any new API for javascript to use in Adobe?
With Regards,
Ravi
Ravi,
Check the Adobe Help in the Designer mostly at this location C:\Program Files\Adobe\Designer 7.1\Documentation\EN. It has some good examples to begin with.
Coming to your issue, the code you have written is not perfect. Write the following code in the exit event of drop-down in JavaScript
if(this.rawValue == "Vendortype1")
{
TextField1.presence = "visible";
TextField2.presence = "visible";
}
else
{
TextField1.presence = "hidden";
TextField2.presence = "hidden";
}
Also if you want hide initially all the text fields when the form is displayed then in the form:ready event of the Main Subform at the top of hierarchy write following code in JavaScript:-
TextField1.presence = "hidden";
TextField2.presence = "hidden";
TextField3.presence = "hidden";
Chintan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chintan,
Thank you for the prompt reply. I have made changes and placed my code in exit event of dropdown and also for hiding I have placed in form:ready event of Sub form.
Now, when I execute(F8) I can see the fields are hiding but when I select the value from dropdown they are not visible..
What could be the mistake?
Regards,
Ravi
Ravi,
Couple of more checks:-
1.Check the case of the value.
2.Try to access the TextFields using complete hierarchy like form1.#subform[0].TextField1.presence and so on.
3. Also most importantly have you saved your form as Dynamic Form ? For this goto Edit menu option --> Select Form Properties --> Goto Defaults tab --> Check what's the preview type --> If its Print then change the Preview type to Interactive Form and XDP Preview Format to Acrobat 7.0.5 Dynamic PDF.
Chintan
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.