Event creation modal

Use the popup to show a modal with an add/edit form for event creation and/or update. The popup can be easily set up to be shown right in the middle of the screen, top, bottom or anchored to the newly added event. Check out the different display modes and play around with the different configurations.

You have full control over what is shown within the popup. Use Mobiscroll form elements or any components that you are already using throughout your application.

Interested in exploring the event calendar?  Check out these examples →
Download and try example

Demo

Loading the live demo

Preview in full screen

Code

mobiscroll.setOptions({
  locale:  ,
  theme: ' ',
  themeVariant: ' '
});

var eventStatus = document.getElementById('demo-popup-status-busy');
var eventTitle = document.getElementById('demo-popup-event-title');
var eventDescription = document.getElementById('demo-popup-event-description');
var eventAllDay = document.getElementById('demo-popup-all-day');

var myData = [
  {
    id: 1,
    start: '2026-10-08T13:00',
    end: '2026-10-08T13:45',
    title: "Lunch @ Butcher's",
    description: '',
    allDay: false,
    bufferBefore: 15,
    free: true,
    color: '#009788',
  },
  {
    id: 2,
    start: '2026-10-23T15:00',
    end: '2026-10-23T16:00',
    title: 'Conference',
    description: '',
    allDay: false,
    bufferBefore: 30,
    free: false,
    color: '#ff9900',
  },
  {
    id: 3,
    start: '2026-10-22T18:00',
    end: '2026-10-22T22:00',
    title: 'Site Visit',
    description: '',
    allDay: false,
    bufferBefore: 60,
    free: true,
    color: '#3f51b5',
  },
  {
    id: 4,
    start: '2026-10-24T10:30',
    end: '2026-10-24T11:30',
    title: 'Stakeholder mtg.',
    description: '',
    allDay: false,
    free: false,
    color: '#f44437',
  },
];

var popup = mobiscroll.popup('#demo-add-event-popup', {
  width: 400,
  contentPadding: false,
  headerText: 'Add new event',
  display: 'center',
  buttons: [
    'cancel',
    {
      text: 'Add',
      keyCode: 'enter',
      handler: function () {
        var eventTimes = range.getVal();
        var newEvent = {
          title: eventTitle.value,
          description: eventDescription.value,
          allDay: eventAllDay.value,
          status: eventStatus.value,
          start: eventTimes[0],
          end: eventTimes[1] || eventTimes[0],
        };
        calendar.addEvent(newEvent);
        calendar.navigateToEvent(newEvent);
        mobiscroll.toast({
          message: 'Event added',
        });
        popup.close();
      },
      cssClass: 'mbsc-popup-button-primary',
    },
  ],
  showOverlay: false,
});

var range = mobiscroll.datepicker('#demo-event-date', {
  controls: ['calendar', 'time'],
  select: 'range',
  startInput: '#demo-popup-start-input',
  endInput: '#demo-popup-end-input',
  display: 'anchored',
  touchUi: true,
  showOverlay: false,
  showRangeLabels: false,
});

var calendar = mobiscroll.eventcalendar('#demo-calendar', {
  view: {
    calendar: { labels: true },
  },
  data: myData,
});

document.getElementById('demo-popup-add-btn').addEventListener('click', function () {
  range.setVal([new Date(), new Date()]);
  mobiscroll.getInst(eventTitle).value = 'New Event';
  mobiscroll.getInst(eventDescription).value = '';
  mobiscroll.getInst(eventAllDay).checked = false;
  mobiscroll.getInst(eventStatus).checked = true;
  popup.open();
});

eventAllDay.addEventListener('change', function () {
  var checked = this.checked;
  // Change range settings based on the allDay
  range.setOptions({
    controls: checked ? ['calendar'] : ['calendar', 'time'],
  });
});
  

Duplicate Session

You have signed in on a different machine. To keep everything in sync, you have been signed out of this session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.

Duplicate Session

We noticed you are logged in on a different machine and have closed your old session.

If you need to invite team members, manage seats and accounts you can do it from the licenses page.