I am developing a form that needs users to input the date of beginning and termination. How to make sure the end date is later than the start date? I plan to notify users by showing a hidden sentence when their inputs are not correct.
<input type="date" name="startDate" defaultValue={experienceToEdit.start_date} onChange={e => setStartDate(e.target.value)} value={startDate}></input>
<input type="date" name="endDate" defaultValue={experienceToEdit.end_date} onChange={e => setEndDate(e.target.value)} value={endDate}></input>
I can handle the comparison part but where I should utilize the comparison function?