I have a webapp that is to be run in a iOS device, and I am trying to call the native datePicker, by clicking in a specific label.
I know that if I have an <input type='date'>
it will open the native datepicker by touching it.
My strategy was to put this input with "opacity: 0" under the label and bind the click event of the label to the trigger event of the input, like this:
$('#pickerLabel').bind('click',function () {
$('#pickerInput').trigger('click');
});
$('#pickerInput').click(function () {
alert("open Picker");
});
What I observed is that this method just triggers the function binded to the click event (it alerts "open Picker") but it does not open the native iOS datePicker, as if I clicked the input itself.
Can you help me?
PS: I have the jquery mobile framework also included in the project and i tried using the tap event in the input and had exactly the same result.