We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to get Default Value from FormField

I am Using latest version of Aspose.words for Java. I need to get Default value inside a Form_Field_Check_box. I could see there are API’s to get checked value like FormField.getChecked() but I culd not find any API for FormField.getDefaultValue() ?? Is there API to get default Value of Form Fields??

@Anbu2Win,

Please try using the following code:

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.insertCheckBox("CheckBox", true, true, 0);

FormField ff = doc.getRange().getFormFields().get(0);
System.out.println(ff.getDefault());

Thanks for your Earliest Reply.

Is there any similar API like
FormField ff = doc.getRange().getFormFields().get(0);
System.out.println(ff.getDefault());

for aspose-words-15.8.0-jdk16.jar. I need to know whether this is possible via the mentioned Jar version also.

@Anbu2Win,

I am afraid, we are not sure whether this will work in 15.8 old version or not. But, this definitely works in latest version of Aspose.Words for Java and we suggest you to please upgrade to the latest version. Please let us know if we can be of any further assistance.