Calculating age & setting up conditions

Home Forums Quform WordPress Calculating age & setting up conditions

This topic is: not resolved
Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #31712
    CaribShipping
    Participant

    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.

    #31715
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31777
    CaribShipping
    Participant

    Thanks 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.

    #31782
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31783
    CaribShipping
    Participant

    Hi 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.

    #31786
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31803
    CaribShipping
    Participant

    Hi 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.

    #31810
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31971
    CaribShipping
    Participant

    Hi 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.
    #31978
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #31994
    CaribShipping
    Participant

    Hi 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.
    Thanks

    #31998
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 12 posts - 1 through 12 (of 12 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy