1

We are utilizing Solspace Calendar, and are allowing Guests to post calendar events (that post as pending), but ONLY want them to be able to post to ONE of the available calendars (we have 4).

Currently the widget displays all 4 calendars...how can we limit to only show the single "Public Events" calendar within this SafeCracker form?

1

Unfortunately the Calendar widget comes as-is, and there is no setting for limiting which Calendar can be used. Calendar does a number of other processes to register the event when selecting a dropdown option. However, with some javascript/jQuery (and perhaps CSS), you could create a script that pre-selects a calendar and hides the dropdown.

The following small jQuery script is an example of a script that would select a calendar_id (ID 9 in this case), then hide the dropdown. Don’t forget to change the val() value to the calendar_id you want selected.

<script>
$(document).ready(function () {
   $('[name="calendar_calendar_id"]').val('9').change().hide();
   $('div#calendar_calendars').next("div").show();
});
</script> 

The hide() function will hide your dropdown after selecting a value.

Old Solspace Forums reference: http://www.solspace.com/forums/viewthread/12433/

| improve this answer | |
  • Great! Don't forget to mark this as a solution if you find this as a good approach. :) – Solspace Aug 19 '13 at 22:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.