--- title: "Pre-Populate Related Events" slug: "pre-populate-related-events" status: "new" updated: 2026-07-21T20:26:20Z published: 2026-07-21T20:26:20Z canonical: "knowledge.technolutions.net/pre-populate-related-events" stale: true --- > ## Documentation Index > Fetch the complete documentation index at: https://knowledge.technolutions.net/llms.txt > Use this file to discover all available pages before exploring further. # Pre-Populate Related Events 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. > [!WARNING] > 📝 Note > > This article uses custom JavaScript. Test the behavior in a test environment before using it on a live event registration form. > [!TIP] > ⭐ Get Inspired > > This article was adapted from [a post by Technolutions staff](https://community.technolutions.net/get-inspired/post/auto-select-events-on-related-event-widgets-W25DrxfOXxoFXOS) in the Slate Community Forums' Get Inspired space. Have a great idea for a Get Inspired post? [Let us know](https://community.technolutions.net/get-inspired/new?post_type=gnHx7As1gZ8r6Ld)! ## Configure the required related events 1. Create or identify the related events that should be selected automatically. 2. Place those related events in a separate folder when you want to keep required sessions separate from optional sessions. 3. Add a **Related Event Widget** to the event registration form. 4. Configure the widget to display the required-event folder. 5. Set a clear export key, such as `relatedevent1`. ![Related Event Widget configured with export key relatedevent1 and a selected event folder](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/01-cqgNuYRDEisWjPAXthxuq.webp) ## Add the auto-select script 1. From the event, select **Edit Scripts/Styles**. 2. 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. ```JavaScript $('[data-export="relatedevent1"] input')[1].click(); ``` ![Event registration form with a related event option automatically selected](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/02-xLqhwOkEDgAp2eNyqxrMs.webp) ### Select multiple options Repeat the input selection line for each option that should be selected. ```JavaScript $('[data-export="relatedevent1"] input')[1].click(); $('[data-export="relatedevent1"] input')[3].click(); ``` ![Related Event Widget with multiple event options selected](https://cdn.us.document360.io/cd8ea7a6-07f3-4846-a554-627ac016d3e3/Images/Documentation/03-r828IpcJp8GU2mSNUS5N6.webp) ### Select the first two options when available ```JavaScript var inputs = $('[data-export="relatedevent1"] input'); if (inputs.length >= 2) {    $(inputs[0]).click();    $(inputs[1]).click(); } ``` ### Select all options ```JavaScript $('[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](https://knowledge.technolutions.net/docs/related-events).