Validate a date question with a select one question

Hello,

I have at the beginig of the form a today type question, and selected-one question has four choices first,second,third,fourth.
I need to insure that the researher couldn’t choice the following:

if choice made (first) and the (today) was not be between 01-01-2023 and 31-03-2023. otherwise alert message.
if choice made (second) and the (today) was not be between 01-04-2023 and 30-06-2023. otherwise alert message.
if choice made (third) and the (today) was not be between 01-07-2023 and 30-09-2023. otherwise alert message.
if choice made (fourth) and the (today) was not be between 01-10-2023 and 31-12-2023. otherwise alert message.

what should I do?

Welcome to the community, @Bushra! You could do it as outlined in the image shared below:

In the survey tab of your XLSForm:

In the choices tab of your XLSForm:

Image 2

Data entry screen as seen in Enketo: when the date is within the range

Data entry screen as seen in Enketo: when the date is outside the range

Reference XLSForm:

Constraint.xlsx (12.3 KB)

Hello Mr. Kal_Lam

First thanks for your solution. It definitely work.

I modifed your logic using the attached file, since it is not allowed to enter the interview_date and it possible to use the constraint and constraint_message for the select_one quarter question.

greatful for your feedback.

(I did not figer how to attached a file!)