• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adding a second or maybe third output to Programming List and Combo Fields.

New Here ,
Mar 21, 2021 Mar 21, 2021

Copy link to clipboard

Copied

Reference Article = https://acrobatusers.com/tutorials/js_list_combo_livecycle/

I have recreated this tutorial for my purposes. However I would like to add a secondary, or more outputs.

 

Example: Select Chasis: Rear Bracket. The output is 205.95 in the Row1.Price. I would also like other outputs in other fields like Row1.Status would output "Inprogress" and Row1.State would output "Broken".

 

var oAssemblyParts = {
	Chasis: [
		["-","None"],
		["Rear Bracket",205.95,"Inprogress","Broken"],
		["Front Bracket",185.95,"Stalled","Working"],
		["Long Support",44.95,"Finished","Stuff"],
		["Front Bearing",48.95,"Stuff","More More Stuff"]

Any help appreciated. Javascript not my first language. 🙂

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF forms

Views

386

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

This can be done in couple of ways, I belive easiest for you would be to use script in "Row1.PartSelect" field as 'Validation',

something like this:

var ss = this.getField("Row1.Status");
var st = this.getField("Row1.State");
if(event.value == "Rear Bracket"){
ss.value = "In progress";
st.value = "Broken";}
else if(event.value == "Front Bracket"){
ss.value = "Stalled";
st.value = "Working";}
else if(event.value == "Long Support"){
ss.value = "Finished";
st.value = "Stuff";}
else if(event.value == "Front Bearing"){
ss.value = "Stuff";
st.value = "More More Stuff";}
else {
ss.value = "";
st.value = "";}

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

Thanks for the reply. This does work (and thanks for that) there is only 1 "check" as it only checks the "Row1.PartSelect" field.

 

I would need "Row1.AssebmlySelect" field check. Then check that the "Row1.PartSelect" field. Then if they both match output the Row1.State & Row1.Status.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 22, 2021 Mar 22, 2021

Copy link to clipboard

Copied

LATEST

First set field  as var:

var aS = this.getField("Row1.AssemblySelect").valueAsString; and then use it like this:

if(aS == "Chasis" && event.value == "Rear Bracket")

If you have delays or it doesn't work for you try moving script to "Calculate".

If you use price as export value in "Row1.PartSelect", then you will need to adapt it to read item instead of export value.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines