Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!
Get Value From Choice Field |
Post Reply |
Author | |
André Labuschagné
Beginner Joined: 20 Sep 19 Location: Sandton Status: Offline Points: 17 |
Post Options
Thanks(0)
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é |
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 Edited by Ingo - 20 Sep 19 at 10:14PM |
|
Cheers,
Ingo |
|
André Labuschagné
Beginner Joined: 20 Sep 19 Location: Sandton Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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é |
|
André Labuschagné
Beginner Joined: 20 Sep 19 Location: Sandton Status: Offline Points: 17 |
Post Options
Thanks(0)
|
Sorted
|
|
Ingo
Moderator Group Joined: 29 Oct 05 Status: Offline Points: 3524 |
Post Options
Thanks(0)
|
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 |
|
André Labuschagné
Beginner Joined: 20 Sep 19 Location: Sandton Status: Offline Points: 17 |
Post Options
Thanks(0)
|
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é |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |
Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. About — Contact — Blog — Support — Online Store