Disable a date depending on what day you're on.

  • retrophonic
    Asked on September 19, 2014 at 6:07 AM

    I'm currently in the process of creating a form, for customer use. The idea is if they have a problem with an item they've purchased they fill a form out and they can select which day they'd prefer for us to come and collect this.

    1. It's week day selection only - done this
    2. They can only select 48 hours in advance - done this
    3. They can't select the day that'd they're on.

    I now need two other things done, which I can't figure out.

    4. If the day is friday I need it so the customer can not select Monday. As we need it to work so you can only select 48 hours on working days. At present you're able to select Monday. So ideally we need it so if the day was Monday the customer could only select Tuesday (next working day).

    5. If the customer selects a past date or a date not "allowed" then an error shows or a warning "can only select 48r in advance". However, even though this error shows, the customer can still submit the form. So is there a way a condition could be created so that if the error appears the customer can't submit the form?

  • Elton Support Team Lead
    Replied on September 19, 2014 at 10:46 AM

    Hi,

    I have cloned your form and make adjustments on the conditions, would you mind checking? http://form.jotformpro.com/form/42614494292963?

    You can clone this form back if this meets the 4 and 5 requirements. I think this is working exactly as you have described.

     

    So this is how it would work,

    Disable a date depending on what day youre on Screenshot 20

    If the selected date is a past date, hide submit button and show the error message. This way, it won't be possible to submit the form.

    If the selected date is 48hrs advanced, show submit button.

    Hope this helps. If there's anything I've missed, let us know.

    Thanks!

     

  • retrophonic
    Replied on September 22, 2014 at 5:01 AM

    Hi EltonCris,

     

    Thanks for that, it works great! However it only works for weekdays.

    Basically if today was Friday we need it so a customer would not be able to select Monday. I thought, as on the calendar the weekends don't "technically" exist then if today was Friday, Monday would be the next day...which is against the 48hr rule.

     

    I guess you can't add a specific rule to a particular day? Because ideally what would be cool would be "Friday +3 show please select dates with a minimum of 48h in advance".

     

    Though I imagine this isn't possible.

  • Ben
    Replied on September 22, 2014 at 10:02 AM

    Hi,

    If I understood you correctly you wanted to keep the current settings that Elton created for you and to add onto it by disabling the Monday as an option if current day is Friday.

    I have made the change to my colleagues jotform so that it includes this new requirement as well and you can check it out here: http://form.jotformpro.com/form/42644258740962

    Disable a date depending on what day youre on Screenshot 30

    Do let us know if that is what you were after.

    This is when I checked the jotform when tricking it that it was Friday. I would suggest checking it on Friday if everything works properly or not. If you can not wait, changing your clocks current date should work instead ;)

    Disable a date depending on what day youre on Screenshot 41

    Best Regards,
    Ben

  • retrophonic
    Replied on September 29, 2014 at 4:28 AM

    This is perfect. Thanks for you help!

  • Elton Support Team Lead
    Replied on September 29, 2014 at 8:36 AM

    @retrophonic

    On behalf of my colleague, you're welcome!

    Cheers! :)