Changing date to empty with Calendar attached to an input

I have a calender attached with input. Calender wasn’t working properly with editable textfield so I made input field read-only. But with this, how can a user change date to empty. I can do it programmatically but what if user sets a date and then decides to clear it out?






In case of editable input it isn’t good solution to open calendar on click inside this input.


You can place the calendar image (or some button) next to the input and open calendar when this image presses.


Initially calendar must be hidden and intialized in a div.








In order to show calendar in a certain position you can use setPosition method:


mCal(x,y)


or


mCal(document.getElementById(“some_id”)); /there can be image or button object/