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!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Get Value From Choice Field
  FAQ FAQ  Forum Search   Register Register  Login Login

Get Value From Choice Field

 Post Reply Post Reply
Author
Message
André Labuschagné View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Sep 19
Location: Sandton
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote André Labuschagné Quote  Post ReplyReply Direct Link To This Post Topic: Get Value From Choice Field
    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é
 
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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



Edited by Ingo - 20 Sep 19 at 10:14PM
Cheers,
Ingo

Back to Top
André Labuschagné View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Sep 19
Location: Sandton
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote André Labuschagné Quote  Post ReplyReply Direct Link To This Post 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é
 
Back to Top
André Labuschagné View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Sep 19
Location: Sandton
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote André Labuschagné Quote  Post ReplyReply Direct Link To This Post Posted: 23 Sep 19 at 9:03PM
Sorted
Back to Top
Ingo View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 29 Oct 05
Status: Offline
Points: 3524
Post Options Post Options   Thanks (0) Thanks(0)   Quote Ingo Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
André Labuschagné View Drop Down
Beginner
Beginner
Avatar

Joined: 20 Sep 19
Location: Sandton
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote André Labuschagné Quote  Post ReplyReply Direct Link To This Post 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é
 
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store