How to conditionally disable field after date?

  • nz_yeehaa
    Asked on October 29, 2017 at 6:00 AM

    I have a field i want to disable after a certain date. i.e: that selection is only possible until...

    and another example -after this date - this field is visible...

    somebody else might express another example - discount available until..

    date based events seem to be non existent?

    i have spent 5hours pushing every button i can find and reading every thread...

    a lot of threads relate to an old version...


  • Nik_C
    Replied on October 29, 2017 at 7:19 AM

    You could use conditional logic for that and disable the field after a certain date:

    1509275845Screen Shot 2017 10 29 at 12 Screenshot 10

    With similar logic you can make the field available again:

    1509275920Screen Shot 2017 10 29 at 12 Screenshot 21

    Could that work for you?

    Please let us know.

    Thank you!

  • nz_yeehaa
    Replied on October 30, 2017 at 3:04 AM

    Hi Nic,

    appreciate your response, and the speed of response... jotform is excelling

    Question first - how do i get notified when there is a response to my question... nothing in login, had to come and find it...


    Reply...

    "could that work for me?"

    NO...

    1509346777jotform Screenshot 10

    I saw something like that on another forum - i dont have those fields...

    and less than gave lots of errors and wasted 4 hours experimenting with every date field i could find to see if I could get less than or greater than working - but they seem to work best on numbers - not dates, or date strings


  • Nik_C
    Replied on October 30, 2017 at 4:27 AM

    Question first - how do I get notified when there is a response to my question... nothing in login, had to come and find it...

    You should receive an email for every response regarding the forum questions.

     Regarding the issue, I'm not sure why you have difficulties. I created this condition:

    1509351875Screen Shot 2017 10 30 at 9 Screenshot 10

    And it works fine:

    1509351936screencast Screenshot 21

    On which field you're working on and how you would like to have it working?

  • nz_yeehaa
    Replied on October 30, 2017 at 7:32 AM

    hi Nic,

    thanks for your response -

    1. notified re:forum question reply emails - hadnt got any - but you may have found some setting - there is a flood of answers in my inbox right now. Thanks 

    back to the question...i realise there are many variables involved...

    several things have become apparent already
    - the link for the form I gave is not clickable
    - you are using a date picker - I am not.
    - It seems a lot of differences are introduced with widgets.

    My original question...
    "I have a field i want to disable after a certain date. i.e: that selection is only possible until..."

    I have used "DateTime Single" widget with time turned off and set to give me todays date with format YYYY-MM-DD - then hidden so the date cant be changed

    I am a computer technician and web designer - I thought it would be as simple as "IF 'todaysDate' is less than 2017-11-30 then do stuff....

    but it is clear it is not.


    As per my image above... the fields are not available to me, and I dont want customer to change date or use the date picker.

    I need todays date to calculate the.....

    ______________

    i found that if you DONT use widgets, and only use *basic* date picker....the before/after fields come available,


    will come back to you soon with results

  • nz_yeehaa
    Replied on October 30, 2017 at 7:59 AM

    tested with *basic* date - lite mode - no past - no future - YYYY-MM-DD - read only - no time - hidden

    have all the correct fields 

    state:after

    state:before

    and it works *** :)


    widgets wouldnt work at all - lesson - dont use widgets....

    will post another about widget errors soon

  • Kiran Support Team Lead
    Replied on October 30, 2017 at 11:01 AM

    Generally, the widgets are loaded on the form using iframe method and the conditions might not work for all the widgets. The default date field is the best field to set the conditions or enable the user to select any specific dates, etc. If you can provide us with the form ID that you are working so that we can take a look and assist you accordingly.

    Thanks!

  • nz_yeehaa
    Replied on October 30, 2017 at 8:53 PM

    hi Kiran, thanks for your reply, this issue is resolved.

    removed the widgets I was using and now use *basic* date only and it works.

    the settings offered earlier in the question were not available until I removed the widget and used the *basic* date

  • John_Benson
    Replied on October 30, 2017 at 11:31 PM

    Thank you for updating us. We're glad that the issue has now been resolved.

    Contact us again here in the Support Forum if you need assistance.