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

Online form with 2 dropdowns selections displaying in textfield

New Here ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Hi.

I am kind of a beginner in creating scripts in adobe and need some help with what i think is a very simple solution. i have tried to look and try soultions in forums, with no luck.I am creating an online form where I have two dropdowns with 5 export values in drop1 and 2 export values i drop2. depending on the combination of the two i want to display a price in a textfield. if none or only dropdown is selected, it should display 0,-

Can anybody please help me?

 

Kind regards Martin

 

Views

836

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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

You can use something like this code as the custom Calculation script of the text field (adjust the field names as values as needed, of course):

 

var v1 = this.getField("Dropdown1").valueAsString;
var v2 = this.getField("Dropdown2").valueAsString;

if (v1=="Option1" && v2=="Option2") event.value = 10;
else if (v1=="Option1" && v2=="Option3") event.value = 15;
else if (v1=="Option2" && v2=="Option1") event.value = 23.4; // etc.
else event.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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Thanks for the quick reply, i`ll try that.

 

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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

I got an "unexpected field v1". Just to let you know, im doing this in web form in adobe.

here is my code:

var v1 = this.getField("modell").valueAsString;
var v2 = this.getField("avtale").valueAsString;

if (v1=="1" && v2=="a") event.value = 1.990;
else if (v1=="1" && v2=="b") event.value = 2.490;
else if (v1=="2" && v2=="a") event.value = 2.490;
else if (v1=="2" && v2=="b") event.value = 2.990;
else if (v1=="3" && v2=="a") event.value = 2.990;
else if (v1=="3" && v2=="b") event.value = 3.990;
else if (v1=="4" && v2=="a") event.value = 2.490;
else if (v1=="4" && v2=="b") event.value = 2.990;
else if (v1=="5" && v2=="a") event.value = 2.990;
else if (v1=="5" && v2=="b") event.value = 4.990;
else event.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
Community Expert ,
Mar 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

What do you mean by "a web form"?

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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

im creating an online webform here https://acrobat.adobe.com/link/home/

because it needs to be filled out a signed online from customers. I uploaded a pdf, and you create fields online. I treid before with a ready form with codes made in acrobat, but the online webform app did not understand the codes. so i try now from scratch.

 

 

martinm68781877_0-1679408315125.png

 

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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

martinm68781877_0-1679409002080.pngmartinm68781877_1-1679409037686.png

 

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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

Yeah, that won't work. You'll need to create a regular PDF file in Acrobat to be able to do it.

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, 2023 Mar 22, 2023

Copy link to clipboard

Copied

So, i got i to work in Acrobat. so thank you for that :-). But its not ideal for the way we want to use it. Need the cutsomer and us to be able to use adobe sign. So is there any way to get it to work with a code in webform?

martinm68781877_0-1679496671598.png

 

 

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, 2023 Mar 22, 2023

Copy link to clipboard

Copied

LATEST

Sorry, I don't know. Try the Adobe Sign forum.

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 21, 2023 Mar 21, 2023

Copy link to clipboard

Copied

I got an "unexpected field v1". Just to let you know, im doing this in web form in adobe.

this is my code:

var v1 = this.getField("modell").valueAsString;
var v2 = this.getField("avtale").valueAsString;

if (v1=="1" && v2=="a") event.value = 1.990;
else if (v1=="1" && v2=="b") event.value = 2.490;
else if (v1=="2" && v2=="a") event.value = 2.490;
else if (v1=="2" && v2=="b") event.value = 2.990;
else if (v1=="3" && v2=="a") event.value = 2.990;
else if (v1=="3" && v2=="b") event.value = 3.990;
else if (v1=="4" && v2=="a") event.value = 2.490;
else if (v1=="4" && v2=="b") event.value = 2.990;
else if (v1=="5" && v2=="a") event.value = 2.990;
else if (v1=="5" && v2=="b") event.value = 4.990;
else event.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