Print Page | Close Window

Get Value From Choice Field

Printed From: Debenu Quick PDF Library - PDF SDK Community Forum
Category: For Users of the Library
Forum Name: I need help - I can help
Forum Description: Problems and solutions while programming with the Debenu Quick PDF Library and Debenu PDF Viewer SDK
URL: http://www.quickpdf.org/forum/forum_posts.asp?TID=3744
Printed Date: 02 May 24 at 7:10PM
Software Version: Web Wiz Forums 11.01 - http://www.webwizforums.com


Topic: Get Value From Choice Field
Posted By: André Labuschagné
Subject: Get Value From Choice Field
Date Posted: 20 Sep 19 at 9:15PM
Hi All
 
I am new to this forum.  Not sure how well this is monitored but here goes.
 
I am looking for a code snippet that will extract the new value from a Choice field [dropdownlist] after the selection has selected one of the options.  This is obviously some Javascript code I am looking for.
 
Thanks in advance.
 
Cheers
André
 



Replies:
Posted By: Ingo
Date Posted: 20 Sep 19 at 10:08PM
Hi Andre,

After LoadFromFile
you should use FormFieldCount.
with the returning value you can create a loop...
...and with GetFormFieldType you can determine the fieldtype: 5 stands for choice.
Additionally with GetFormFieldChoiceType you can check the type of choice-field: List, Combo, Multiselect, Combo with edit, ...
With GetFormFieldTitle you can get the internal name of the form field.
With GetFormFieldValue you can get the actual value which was activated or inserted in a NORMAL form field.
Regarding choice fields you should use something similar to this:
If QP.GetFormFieldKidCount(integer value) <> 0 ...
for i2 := 2 to QP.GetFormFieldSubCount(i1) do
  nffvalue := QP.GetFormFieldSubName(i1, i2);

Here's a sample from Debenu about how to extract form field data from a form:
https://www.debenu.com/kb/programmatically-extract-form-field-data-pdf-files/

This should be your starting point for all neede informations:
http://www.quickpdf.org/

BTW: It's important if it's an acro- or an xfa-form. Syntax and functions differs a bit but you can read about it on the official pages online.
For example this one:
https://www.debenu.com/kb/can-debenu-quick-pdf-library-print-pdf-forms-use-xfa-form-fields/


 
Cheers and welcome here,
Ingo



-------------
Cheers,
Ingo



Posted By: André Labuschagné
Date Posted: 21 Sep 19 at 12:46AM
Hi Ingo
 
Thanks for that.  But I may not have made myself clear enough.
 
I need to detect what the choice is when the end user actually makes the choice while filling in the form.  Immediately after the choice I need to take some action and in some cases set the attributes of some other fields.  So this is in real time, not after submission.
 
Does that make sense?
 
Cheers
André
 


Posted By: André Labuschagné
Date Posted: 23 Sep 19 at 9:03PM
Sorted


Posted By: Ingo
Date Posted: 29 Sep 19 at 1:56PM
back from holidays... :)

what do you mean with "sorted"?

If you want to check something in real time your idea with javascript is the best idea.
QuickPDF allows to link embedded javascript code to form field (actions).
Here are the relevant functions for this:
https://www.debenu.com/docs/pdf_library_reference/JavaScript.php



-------------
Cheers,
Ingo



Posted By: André Labuschagné
Date Posted: 29 Sep 19 at 4:09PM
Hi Ingo
 
Glad you are back from the holidays.  Things are pretty lonely here as there are no participants.  Hope you had a good one.
 
Got it sorted with javascript code - thanks for the link.
 
Cheers
André
 



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.01 - http://www.webwizforums.com
Copyright ©2001-2014 Web Wiz Ltd. - http://www.webwiz.co.uk