Date calculation and change dropdown value on match

Home Forums Quform WordPress Date calculation and change dropdown value on match

This topic is: resolved
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #18544
    sergiobru
    Participant

    Hi there,

    I need to calculate the difference between today’s date and the date selected in the form, and if the difference is less than 18 years – I need to automatically change the dropdown value in another field.

    Please, have a look: http://sma.essencehost.com/new-student-application/

    The ‘Student info’ section has ‘Date of birth’ field.
    I want to calculate the date selected in this field and compare it to today’s date on the fly, and if the difference is less than 18 years – I need the ‘Legal’ dropdown to change the value to ‘Yes’.

    Why I’m doing this?
    The ‘Legal’ field triggers the ‘Guardians’ block below the contact info when it’s set to ‘Yes’. I did this using conditional logic.
    Now I want to hide the ‘Legal’ field via CSS and have the date calculation change the value from ‘No’ to ‘Yes’ if student’s age is under 18.

    Can this be done?

    #18561
    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.

    #18767
    sergiobru
    Participant

    Thanks, that’s a neat solution indeed. Works great.

Viewing 3 posts - 1 through 3 (of 3 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