If function with a time picker issue

Solved the issue i linked my submit button to a function to check the meals before submission that seemed to be causing the error for some reason.

elseif($w("meal1timePicker").value.length <1){

this always seems to work best for me for validating elements before a submission is sent to collection