Home › Forums › Quform WordPress › Calculating age & setting up conditions
- This topic has 11 replies, 2 voices, and was last updated 4 years, 2 months ago by Ally.
- AuthorPosts
- July 28, 2020 at 2:53 pm #31712CaribShippingParticipant
Hello, could you help us with calculating the age of an X item (current date – date picked by user), place it the result inside a field (or/and) be able to set logical conditions related to that field (ex. if age > 6 then show note or if age <6 then price based on (Y choice) equal to $500)?
Thanks.July 29, 2020 at 9:57 am #31715AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 17, 2020 at 3:40 pm #31777CaribShippingParticipantThanks for the response.
Is it possible instead of a date picker, to put a dropdown where user can choose the date of purchase up to 25 years and >25) and automatically do the same calculations based on the current date?
Same rules as per my prior message, in that case and put that in an hidden field.
Thanks in advance.August 18, 2020 at 11:36 am #31782AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 18, 2020 at 11:41 am #31783CaribShippingParticipantHi Ally,
but how can I keep the current date relevant and always subtract the year the user chose (dropdown) from the current day with the logic fields?Thanks.
August 20, 2020 at 9:52 am #31786AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 24, 2020 at 9:32 am #31803CaribShippingParticipantHi Ally,
the values will be years (when the vehicle was purchased), starting from the current year (2020) and back to 25 years (1995) and a value which represents any year before 1995.Thanks.
August 25, 2020 at 10:56 am #31810AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 23, 2020 at 1:38 pm #31971CaribShippingParticipantHi Ally, I know it’s been a while,but I just tried to implement the code and it won’t work, if I’m not missing something.
Please have a look at the current form and image attached:
https://caribshipping.co.uk/vehicle-shipping-quote/When I choose 2015 for example, I need the code to calculate (current year -2015) and give the years at the hidden field.
Then I’ll use with other variables to calculate if it’s too old and show a text note.
At this stage, that calculation is not happening.
Am I doing something wrong?Thanks.
Attachments:
You must be logged in to view attached files.September 24, 2020 at 10:22 am #31978AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
September 28, 2020 at 12:43 pm #31994CaribShippingParticipantHi Ally, you’re right, I just changed the code and it works.
Someting last,
can I add a field where price will be calculated based on different conditions?
Ex. If age of vehicle is that (taken from field), and type is that (another field), then give this price (in a field). That’s just an example, I need to use more variables.
ThanksSeptember 29, 2020 at 9:51 am #31998AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.