Initializing the picker
The date picker can be used on a Mobiscroll input or any other input part of an existing form.
There are two ways to use the date picker:
- Initialize it on a single input, either Mobiscroll or non-Mobisroll input.
- Embed the picker without an input. This can be the page itself or a more complex popup
Demo
Initialize it on any input, like a new mobiscroll field or an existing field from your form.
html<label>
Date
<input id="date" mbsc-input placeholder="Please select..." />
</label>
jsmobiscroll.datepicker('#range', {
controls: ['date']
});
It can be embedded into the page or a popup as an inline picker by setting the display option to inline. You can choose to initialize the picker on an input type="hidden" or just simply a div.
html<div id="date"></div>
jsmobiscroll.datepicker('#date', {
controls: ['date'],
display: 'inline'
});
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
mobiscroll.datepicker('#demo-one-input', {
controls: ['date'],
showRangeLabels: true,
display: 'anchored',
});
mobiscroll.datepicker('#demo-init-inline', {
controls: ['date'],
showRangeLabels: true,
display: 'inline',
});
<label>
Date
<input id="demo-one-input" mbsc-input data-input-style="outline" data-label-style="stacked" placeholder="Please select..." />
</label>
<div id="demo-init-inline"></div>