Input Field or Inline Embed
The calendar can be used on a Mobiscroll input or any other input part of an existing form.
There are two ways to use the calendar:
- 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>
Calendar
<input id="calendar" mbsc-input placeholder="Please select..." />
</label>
jsmobiscroll.datepicker('#range', {
controls: ['calendar']
});
Use it for multiple date picking with a mobiscroll input and pill rendering for the selected values.
html<div id="calendar"></div>
jsmobiscroll.datepicker('#calendar', {
controls: ['calendar'],
selectMultiple: true
});
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="calendar"></div>
jsmobiscroll.datepicker('#calendar', {
controls: ['calendar'],
display: 'inline'
});
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
mobiscroll.datepicker('#demo-one-input', {
controls: ['calendar'],
showRangeLabels: true,
display: 'anchored',
});
mobiscroll.datepicker('#demo-init-inline', {
controls: ['calendar'],
showRangeLabels: true,
display: 'inline',
});
<label>
Calendar
<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>