Copy link to clipboard
Copied
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
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;
}
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Hi, thanks for the reply.
Number of weeks required - "Rental Number of weeks required"
Pricing - "Pricing per Week"
Amount - "Running total
Copy link to clipboard
Copied
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;
}