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

Form Calculation Help. Multiply two fields plus delivery

New Here ,
Jun 26, 2024 Jun 26, 2024

HI, I've been asked to create an interactive quote form.

 

The product is rental, so I need to show "the price per week", multiplied by the "number of weeks" the customer needs it for, "plus £250 delivery". 

 

The number of weeks required must be a minimum of 6 weeks too.

 

What do i need to put in the total field calculation please.?

thank you

 

Screenshot 2024-06-26 at 10.54.31.png

TOPICS
Create PDFs , Edit and convert PDFs , How to , PDF , PDF forms
453
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
1 ACCEPTED SOLUTION
Community Expert ,
Jun 26, 2024 Jun 26, 2024
LATEST

As the custom calculation script for "Pricing per Week" enter the following:

 

var v1 = Number(this.getField("Rental Number of weeks required").valueAsString);
var v2 = Number(this.getField("Pricing").valueAsString);
if (v1==0 || v2==0) event.value = "";
else event.value = (v1*v2)+250;

 

As the custom validation script for "Rental Number of weeks required" enter the following:

 

if (event.value && Number(event.value)<6) {
	app.alert("Minimum 6 weeks rental.");
	event.rc = false;
}

View solution in original post

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 ,
Jun 26, 2024 Jun 26, 2024

What are the actual names of the fields involved?

The latter is not related to the total calculation. You will need to use a custom validation script on that field to do it.

 

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
New Here ,
Jun 26, 2024 Jun 26, 2024

Hi, thanks for the reply.

 

Number of weeks required - "Rental Number of weeks required"

Pricing  - "Pricing per Week"

Amount - "Running total 

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 ,
Jun 26, 2024 Jun 26, 2024
LATEST

As the custom calculation script for "Pricing per Week" enter the following:

 

var v1 = Number(this.getField("Rental Number of weeks required").valueAsString);
var v2 = Number(this.getField("Pricing").valueAsString);
if (v1==0 || v2==0) event.value = "";
else event.value = (v1*v2)+250;

 

As the custom validation script for "Rental Number of weeks required" enter the following:

 

if (event.value && Number(event.value)<6) {
	app.alert("Minimum 6 weeks rental.");
	event.rc = false;
}
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