Hi @Kal_Lam
Can we set a condition on the form’s date field like
if {accepted} is yes , then date selection can not more than 14 days from today ,
if {accepted} is NO, then date selection can not more than 03 days from today
Cheers !
Neeraj
Hi @Kal_Lam
Can we set a condition on the form’s date field like
if {accepted} is yes , then date selection can not more than 14 days from today ,
if {accepted} is NO, then date selection can not more than 03 days from today
Cheers !
Neeraj
Did not understand the accepted
you are referring to. Could you kindly simplify them?
accepted is a select_one field
You could do it as outlined in the image shared below:
Hi @Kal_Lam
Thanks for response , But what i need is that the date selection should not be allowed ( restricted ) based on condition
if {accepted} is yes , then date selection can not more than 14 days from today ,
if {accepted} is NO, then date selection can not more than 03 days from today
that means if today is 14/05/2021 , selection of date should not be allowed 28-05-2021 or 17-05-2021 respectively
Cheers !
Neeraj
Hi @Kal_Lam
i tried this in calculation field but not working
if(${accepted} = ‘No’,(.>today() and .<today()+3),(.>today() and .<today()+14))
Please help
Hi @caneeraj
Create a date question and add a constraint using the calculate row provided by @Kal_Lam ${date2}. You need to add the following in constraint
.=${date1} and .<=${date2}
Regards,
Stephane
Hello,
Hint: today() will dynamically be re-calculated, for example when you re-open the form on the device or later when you edit a submission on server level. So, the previously entered day may become invalid on new save.
You can avoid this by
You may need to sharpen the requirement what you exactly want to control when, taking into account later re-edit of the form data.
Hi Every one ,
Thanks i was able to do by using if condition in constraint column.
if(${accepted} = ‘No’,(.>today() and .<today()+3),(.>today() and .<today()+14))
Thanks @wroos , your hint was actually good.
Cheers !
Neeraj
Hello,
So, the problem was just using the wrong column: calculation instead of constraint?
I also adapted the tags of the thread (… constraint).
@caneeraj, maybe you could do it as outlined in the image shared below: