Relative Content

Tag Archive for javascriptsalesforce

How to lose focus on ui:inputDate tag when the date selected is cleared or erased by the user using javascript?

My issue is on Mobile part. I have the Birthday date field on my Register Aura component and its using ui:inputDate tag. The client wants to redisplay the placeholder immediately when the date field is empty due to reset/clearing of selected date. Now, I already have a function that can add a placeholder as soon as the date field loses its focus. So I just wanna detect if the date field is empty so I can lose its focus or redirect the focus to my other elements in order to redisplay the Birthday placeholder. I tried using event listeners but its not really working. So far my handleBirthdayChange on my controller file looked like this below. Please disregard the other codes because its for other functionality: