make datePicker a mandatory field in self made form

Hi Corvid!

I’m busy with making a form for job application and I want to know starting which date the applicant is available. My problem is that the user can submit the form without filling in the date. I tried these four syntaxes but all of them don’t work as expected:

 if ($w('#datePicker1').value === 0) {
return;
}
 if ($w('#datePicker1').value.length === 0) {
return;
}
 if ($w('#datePicker1').value.trim().length === 0) {
return;
}
 if ($w('#datePicker1').value.trim() === 0) {
return;
}

Could someone help me find the right syntax? (I tried looking it up on the CORVID API without any luck)

Best,
Sander

You can use the valid ( validationMessage )or the required function

Thanks! I’ll check it out