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

Default Vaalue in ComboBox

sarfarajsayyad
Registered: May 6 2007
Posts: 18

How to Show Default value in combo box
using Adobe Javascript?
i am trying for DropDownList1.DefaultValue="a";
but this Doesn’t work please give me solution
 
Regards,
Sarfaraj Sayyad

My Product Information:
Acrobat Standard 8, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
First, the code you provided above

DropDownList1.DefaultValue = "a";

is incorrect in both AcroForms and LiveCycle forms JavaScript. Let's assume that you are using AcroForms. Then the default is set with:

this.getField("DropDownList1").defaultValue = "a";

Where "a" is an existing entry on the Combox list. This code sets the default value for the field. It does not display it. Default values for all fields, in any forms technology, are displayed when the form is reset. In AcroForms, a form is reset with.

this.resetForm();

Which resets the entire form. If you just want to reset the combobox then use this

this.resetForm("DropDownList1");

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script