Forms - Combo Box: Display Value vs. Export Value

Forum for the PDF-XChange Editor - Free and Licensed Versions

Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Paul - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange

User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Forms - Combo Box: Display Value vs. Export Value

Post by Peter2 »

What is the meaning of "Display Value vs. Export Value"? I thought it could be different - e.g. a string displayed for the user ("beautiful / medium / ugly") and exported numbers for the computer (1 / 2 / 3). But it is always the same ..
grafik(1).png
You do not have the required permissions to view the files attached to this post.
PDF-X-Change Pro German
Willy Van Nuffel
User
Posts: 2777
Joined: Wed Jan 18, 2006 12:10 pm

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Willy Van Nuffel »

It seems like you can edit these Combo Box Items after their creation, by clicking once and then clicking one again, so that a blinking cursor shows up and you can start editing. See screenshot.
You do not have the required permissions to view the files attached to this post.
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19919
Joined: Mon Jan 12, 2009 8:07 am

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Stefan - PDF-XChange »

Hello Willy Van Nuffel, Peter2,

Yes - the idea is exactly that - to display some meaningful values to the user, and then send a different one (e.g. the ID of said option) to the computer for processing.
And as Willy pointed out - those can indeed be updated after creation.

Kind regards,
Stefan
User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Peter2 »

Thanks,
I got it.
PDF-X-Change Pro German
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19919
Joined: Mon Jan 12, 2009 8:07 am

Forms - Combo Box: Display Value vs. Export Value

Post by Stefan - PDF-XChange »

:)
User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Peter2 »

I'm searching / hoping for a "Copy&Paste" feature to fill these values. I have some lists with 5-20 values ...
PDF-X-Change Pro German
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19919
Joined: Mon Jan 12, 2009 8:07 am

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Stefan - PDF-XChange »

Hello Peter2,

You should be able to "quickly" create a combobox (dropdown) with some JS
Here is a page of the JS API with such a sample:
Page 374 from js_api_reference.pdf
Kind regards,
Stefan
You do not have the required permissions to view the files attached to this post.
User avatar
Peter2
User
Posts: 958
Joined: Mon Sep 13, 2010 10:09 am

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Peter2 »

Thanks, Stefan.
PDF-X-Change Pro German
User avatar
Stefan - PDF-XChange
Site Admin
Posts: 19919
Joined: Mon Jan 12, 2009 8:07 am

Forms - Combo Box: Display Value vs. Export Value

Post by Stefan - PDF-XChange »

:)
jotess
User
Posts: 37
Joined: Tue Jan 08, 2019 11:07 am

Re: Forms - Combo Box: Display Value vs. Export Value

Post by jotess »

Hello,
I'm pretty novice to JS, so I'm not sure if I understand correctly. Is this explanation:
Stefan - PDF-XChange wrote: Thu Oct 13, 2022 10:45 am ...
You should be able to "quickly" create a combobox (dropdown) with some JS
Here is a page of the JS API with such a sample:
Page 374 from js_api_reference.pdf
...
meant for the case when I'm designing a form (not when I'm using it) and when I want to populate the combo box with its initial values? This is what I'm trying and I have a very long list of values that I would not like to enter by hand.
Best regards, Joachim
Mathew
User
Posts: 689
Joined: Thu Jun 19, 2014 7:30 pm

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Mathew »

Peter2 wrote: Thu Oct 13, 2022 9:30 am I'm searching / hoping for a "Copy&Paste" feature to fill these values. I have some lists with 5-20 values ...
If you use Tab as a delimiter, I think the paste option will put them in the correct locations:
image(2).png
image.png
thus:
image(1).png
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11794
Joined: Wed Jan 03, 2018 6:52 pm

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Daniel - PDF-XChange »

Hello, Mathew

This is probably the fastest way to hand it at the moment, Tab delimiting was actually a surprise to me, but it works quite nicely!

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com
Mathew
User
Posts: 689
Joined: Thu Jun 19, 2014 7:30 pm

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Mathew »

...all that and I went down the rabbit hole: Here's a script that makes a dialog to edit the Display and Export values for all the combo- and list-box fields in the document.

Installation
Extract the zip file. It can be run from the Console; or copied to the JavaScripts folder in which case it will add a menu item to the Forms ribbon (or Form > Manage Form Data in the classic toolbars)
image.png
setComboValues v1.0.zip

Usage
The tool opens a dialog in which there is a dropdown at the top to select the field to edit, and a text box with all the field options:
image(1).png

Translations
The tool can be translated if 1ang.js is installed. Here are the translation strings (save to "translationData.setComboValues.json" in the JavaScripts folder) -- there's a machine translation to German:

Code: Select all

# Translation file (requires 1ang v1.0 or later)
# Domain for this translation file is "setComboValues"
# Filename must be "translationData.setComboValues.json" and saved in the JavaScripts folder

# It is not necessary for all strings to be included in every language,
#   but don't put an empty string "" for the translation, because that's what will be shown!
# This must be formatted as a JSON file except that:
#   lines starting with # and empty lines are stripped out before processing

# "Language" is three letter code as output from app.language
# "Original Text" is case sensitive!
#   Notice that the last item in a list does not allow a comma after it.
# Format:
#  "Language 1": {
#    "Original Text": "Translated Text in Language 1",
#    "Original Text 2": ["Translated Text 2 singular", "Translated Text 2 plural"]
#   },
#  "Language 2": {
#    "Original Text": "Translated Text in Language 2"
#   }

{
 "": {
     "Set Combo Values": "",
     "Format is one line for each option:\nDisplay Value%sExport Value": "",
     "Set the values for field:": "",
     "Delimiter:": "",
     "Ctrl + Tab to enter Tab": "",
     "No List Box or Combo Box Fields found in this document.": "",
     "User Cancelled.": "",
     "Updating field '%1'": "",
     "Set Combo Values…": ""
 },
 "DEU": {
     "Set Combo Values": "Kombinationswerte Festlegen",
     "Format is one line for each option:\nDisplay Value%sExport Value": "Format ist eine Zeile für jede Option:\nAnzeigewert%sExportwert",
     "Set the values for field:": "Werte für Feld festlegen:",
     "Delimiter:": "Trennzeichen:",
     "Ctrl + Tab to enter Tab": "Strg + Tabulatortaste, um Tabulator einzugeben",
     "No List Box or Combo Box Fields found in this document.": "Keine Listen- oder Kombinationsfeldfelder in diesem Dokument gefunden.",
     "User Cancelled.": "Benutzer hat abgebrochen.",
     "Updating field '%1'": "Feld '%1' wird aktualisiert",
     "Set Combo Values…": "Kombinationswerte Festlegen…"
 }
}
You do not have the required permissions to view the files attached to this post.
User avatar
Daniel - PDF-XChange
Site Admin
Posts: 11794
Joined: Wed Jan 03, 2018 6:52 pm

Re: Forms - Combo Box: Display Value vs. Export Value

Post by Daniel - PDF-XChange »

Hello, Mathew

Ohh, this looks like a fun tool, thank you Mathew!

Kind regards,
Dan McIntyre - Support Technician
PDF-XChange Co. LTD

+++++++++++++++++++++++++++++++++++
Our Web site domain and email address has changed as of 26/10/2023.
https://www.pdf-xchange.com
Support@pdf-xchange.com