Use custom JavaScript to automatically select one or more options in a Related Event Widget. This setup is useful when an event registration should include required sessions, such as check-in, a welcome session, or a required meeting time.
📝 Note
This article uses custom JavaScript. Test the behavior in a test environment before using it on a live event registration form.
⭐ Get Inspired
This article was adapted from a post by Technolutions staff in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? Let us know!
Configure the required related events
Create or identify the related events that should be selected automatically.
Place those related events in a separate folder when you want to keep required sessions separate from optional sessions.
Add a Related Event Widget to the event registration form.
Configure the widget to display the required-event folder.
Set a clear export key, such as
relatedevent1.

Add the auto-select script
From the event, select Edit Scripts/Styles.
Add the script that matches the selection behavior you need.
Select one option
The following script selects the second option in the widget. JavaScript indexes start at 0, so [1] selects the second input.
$('[data-export="relatedevent1"] input')[1].click();
Select multiple options
Repeat the input selection line for each option that should be selected.
$('[data-export="relatedevent1"] input')[1].click();
$('[data-export="relatedevent1"] input')[3].click();
Select the first two options when available
var inputs = $('[data-export="relatedevent1"] input');
if (inputs.length >= 2) {
$(inputs[0]).click();
$(inputs[1]).click();
}Select all options
$('[data-export="relatedevent1"] input').each(function(index, element) {
$(element).click();
});Considerations
Use checkboxes when more than one related event can be selected. Option buttons allow only one selection.
If the required related events should not be visible, hide the required-event widget after confirming that the script works.
Registrant limits for required related events should not be lower than the registrant limit for the main event.
For more information, see Related Events.