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

Help with simple conditional form

Community Beginner ,
Aug 06, 2018 Aug 06, 2018

Hi,

I just need to create a calculation in which, in column A (Número de tarjetas a almacenar) you have a list of options to be selected. Depending on the option you select, the price is shown on column B.

Singular Fact captura _379.jpg

Just with this, I would be really happy :-).

An aditional question is if I can determine as an exeption that if you select the last option "Más de 10000", then the price "Coste mensual" is calculated with a formula which is a number from another box* 3

Many thanks!

TOPICS
Acrobat SDK and JavaScript
1.0K
Translate
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

correct answers 1 Correct answer

Community Expert , Aug 06, 2018 Aug 06, 2018

OK. As the custom calculation script of the text field you can enter something like this:

var v = this.getField("Número de tarjetas a almacenar").valueAsString;

if (v=="0 - 300") event.value = "8€";

else if (v=="300 - 600") event.value = "11€";

else if (v=="600 - 1000") event.value = "15€";

// etc.

Translate
Community Expert ,
Aug 06, 2018 Aug 06, 2018

You need to provide the full details of which value should appear in the text field for each of the values selected in the drop-down.

Translate
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 Beginner ,
Aug 06, 2018 Aug 06, 2018

0 - 300                   8€

300 - 600               11€

600 - 1000               15€

1000 - 3000               35€

3000 - 5000               60€

5000 - 10000               100€

Mas de 10.000               Precio personalizado

Thanks!

Translate
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 ,
Aug 06, 2018 Aug 06, 2018

OK. As the custom calculation script of the text field you can enter something like this:

var v = this.getField("Número de tarjetas a almacenar").valueAsString;

if (v=="0 - 300") event.value = "8€";

else if (v=="300 - 600") event.value = "11€";

else if (v=="600 - 1000") event.value = "15€";

// etc.

Translate
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 Beginner ,
Aug 06, 2018 Aug 06, 2018

Thank! It works!

Translate
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 Beginner ,
Aug 06, 2018 Aug 06, 2018

One last thing. How can I say if a value from column A is greater than 10000 then multiply by 0,03?

Thanks!!

Translate
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 ,
Aug 06, 2018 Aug 06, 2018

Multiply what, exactly?

Translate
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 Beginner ,
Aug 06, 2018 Aug 06, 2018

So basically if I write a number higher than 10000 on column A multiply it by 0,03 on column B. Otherwise write "Not valid" on column B

Singular Fact captura _382.jpg

Translate
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 ,
Aug 06, 2018 Aug 06, 2018

Is "Column A" the drop-down field? If not, what is the name of that field, and that of Column B?

Translate
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 Beginner ,
Aug 06, 2018 Aug 06, 2018

No drop down as I had to separate 1 range.

Column A field is called "ServiciosPlus-Tarjetasincluidas10000"

Column B is the calculation destination, called "ServiciosPlus-Coste10000"

Whatever value I put in column A needs to be multiplied by 0,03 except if it is under 10000 (if that´s the case a "Not valid" message should be shown

thanks!!

Translate
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 ,
Aug 06, 2018 Aug 06, 2018

OK, then use this code as the custom calculation script of the second field:

var v = Number(this.getField("ServiciosPlus-Tarjetasincluidas10000").valueAsString);

if (v<10000) event.value = "Not valid";

else event.value = v * 0.03;

Translate
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 Beginner ,
Aug 06, 2018 Aug 06, 2018
LATEST

Thanks again!

Translate
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