Hi Guys,
I have an issue with specific scenario and unable to solve it.
Please find the scenario below :
I have a travel website, in the tour details page I have a custom form for my user to fill. Based on the user’s preference, the final tour amount gets calculated. there are 3 variables to calculate the final amount :
-
Base Amount = baseAmount
-
Type of Meal = meal
-
No. of Child = nrOfchild
The Calculation is happening in a text field = totalSumLabel
The calculation is happening perfectly, my problem is I cannot find a way to get this calculated amount in my database.
Now coming to the database side, in 1 dynamic page there are 2 collections attached.
1st is for the tour information like Tour name, Base Amount, Tour details etc.
2nd is for storing User’s Input
Calculation is happening based on the data of 1st Database and the final amount I want to store in the 2nd Database.
Sharing Screenshots below :
Databases :
Andaman Nicobor Island : Tour details dataset
User Data : Stores User input, want to store the Total Tour Amount in this database (Totalamount Field)
Step 1: Users choose their preference and the final amount is getting calculated perfectly.
Code of calculation :
$w . onReady ( function () {
});
export function dropdown1_change ( event ) {
let baseAmount = Number ( $w ( “#baseAmount” ). value );
$w ( “#totalSumLabel” ). text = ₹ ${( baseAmount ). toString ()}
;
}
export function nrOfPeople_click ( event ) {
let meal = Number ( $w ( “#meal” ). value );
let baseAmount = Number ( $w ( “#baseAmount” ). value );
let nrOfchild = Number ( $w ( “#nrOfchild” ). value );
$w ( “#totalSumLabel” ). text = ₹ ${(( baseAmount + nrOfchild )+ meal ). toString ()}
;
}
export function nrOfchild_change ( event ) {
let nrOfchild = Number ( $w ( “#nrOfchild” ). value );
let meal = Number ( $w ( “#meal” ). value );
let baseAmount = Number ( $w ( “#baseAmount” ). value );
$w ( “#totalSumLabel” ). text = ₹ ${(( baseAmount + nrOfchild )+ meal ). toString ()}
;
}
Step 2 : User clicks on the Get Quote Button and all the user inputs are getting stored in the user database.
Tried to connect totalSumLabel field with the database through connect to database option but still it is not capturing any data, result is blank.
Please help me to get the field value in the database.
Thanks
Ratnadeep
+917059104334