creates combined checkbox cookie "user_role" */ // Wait for DOM to be fully loaded before initializing document.addEventListener("DOMContentLoaded", function () { // Select all input elements with the data-set-cookie attribute // These inputs will automatically save their values as cookies when changed const cookieInputs = document.querySelectorAll("[data-set-cookie]"); /** * Sets a cookie with the specified name, value, and expiration * @param {string} name - The name of the cookie * @param {string} value - The value to store in the cookie * @param {number} days - Number of days until cookie expires (default: 365) */ function setCookie(name, value, days = 365) { // Calculate expiration date const expires = new Date(); expires.setTime(expires.getTime() + days * 24 * 60 * 60 * 1000); // Set the cookie with proper encoding and site-wide path // encodeURIComponent ensures special characters are handled safely document.cookie = `${name}=${encodeURIComponent( value )};expires=${expires.toUTCString()};path=/`; } // Attach change event listeners to each tracked input cookieInputs.forEach((input) => { input.addEventListener("change", function () { // Get the cookie name from the data-set-cookie attribute const cookieName = this.getAttribute("data-set-cookie"); // Get the current value of the input const cookieValue = this.value; // Only set the cookie if we have a valid cookie name if (cookieName) { // Store the input value as a cookie setCookie(cookieName, cookieValue); } }); }); // === CHECKBOX LIST HANDLING === // This section handles elements that contain multiple checkboxes where we want to // combine the labels of all checked items into a single semicolon-separated cookie value // // Expected HTML structure: //
//
// //
Option 1
//
//
// //
Option 2
//
//
// Find all container elements that have the data-list-set-cookie attribute const checkboxLists = document.querySelectorAll("[data-list-set-cookie]"); /** * Gets the label text for a checkbox by traversing up to find .form_checkbox-field * and then finding the nested .form_checkbox-label * * DOM traversal path: checkbox -> closest('.form_checkbox-field') -> querySelector('.form_checkbox-label') * * @param {HTMLElement} checkbox - The checkbox input element * @returns {string|null} - The label text or null if not found */ function getCheckboxLabel(checkbox) { // Navigate up the DOM tree to find the closest parent with class 'form_checkbox-field' const fieldContainer = checkbox.closest(".form_checkbox-field"); if (fieldContainer) { // Look for a child element with class 'form_checkbox-label' within the field container const labelElement = fieldContainer.querySelector(".form_checkbox-label"); if (labelElement) { // Extract and clean up the text content, removing any extra whitespace return labelElement.textContent.trim(); } } // Return null if the expected DOM structure is not found return null; } /** * Gets all checked checkbox labels within a checkbox list element and combines them * into a semicolon-separated string * * Example output: "Content Developer; State, District or Education Leader" * * @param {HTMLElement} listElement - The element with data-list-set-cookie attribute * @returns {string} - Semicolon-separated list of checked labels */ function getCheckedLabels(listElement) { // Find all checkbox inputs within this list container const checkboxes = listElement.querySelectorAll('input[type="checkbox"]'); const checkedLabels = []; // Loop through each checkbox in the list checkboxes.forEach((checkbox) => { // Only process checkboxes that are currently checked if (checkbox.checked) { // Get the associated label text for this checkbox const label = getCheckboxLabel(checkbox); // Only add to our list if we successfully found a label if (label) { checkedLabels.push(label); } } }); // Combine all checked labels into a semicolon-separated string // Example: ["Option 1", "Option 2"] becomes "Option 1; Option 2" return checkedLabels.join("; "); } // Set up event listeners for each checkbox list container checkboxLists.forEach((listElement) => { // Find all checkboxes within this specific list container const checkboxes = listElement.querySelectorAll('input[type="checkbox"]'); // Get the cookie name from the data-list-set-cookie attribute value const cookieName = listElement.getAttribute("data-list-set-cookie"); // Only proceed if we have a valid cookie name if (cookieName) { // Attach a change event listener to each checkbox in this list checkboxes.forEach((checkbox) => { checkbox.addEventListener("change", function () { // When any checkbox changes, recalculate the combined value of all checked items const combinedValue = getCheckedLabels(listElement); // Store the combined value as a cookie // This will update the cookie every time any checkbox in the list is changed setCookie(cookieName, combinedValue); }); }); } }); });

About ELSF

The English Learners Success Forum (ELSF) is a collaboration of researchers, teachers, district leaders, and funders who are passionate about improving the quality and accessibility of instructional materials for English learners (ELs).

Our Mission

To expand educational equity for multilingual learners by increasing the supply of high-quality instructional materials that center their cultural and linguistic assets.

Our Vision

To ensure every multilingual student engages in learning that allows them to thrive academically and choose their path for success.

Our Reach

We work with every stakeholder in the instructional materials landscape to ensure that multilingual learners are included in the design, adoption and implementation of materials.

1.4 million multilingual learners impacted.
Through our partnerships with states and districts, we’ve helped educators improve content delivery for over 1.4 million multilingual learners.
52 instructional products transformed.
We worked alongside publishers and developers to embed multilingual learner supports into 52 instructional programs, shaping the materials used in classrooms nationwide.
Partnering with the biggest names in education.
We’ve collaborated with 19 of the most influential curriculum developers, representing the majority of the K–12 market.
A national impact.
Our initiatives have influenced educational practices in 10 states, improving learning experiences for multilingual students nationwide.

ELSF Over the Years

ELSF was founded in 2017 to support multilingual learners by improving the quality, accessibility, and implementation of responsive curriculum materials.

2018
English Language Arts and Mathematics Guidelines released, first Content Developer Institute & Reviewer trainings took place, a pilot process to review materials began.
2020
Partnered with 6 publishers, responded to COVID crisis by supporting organizations remotely, continued to grow our network of practitioners, researchers, and experts virtually.
2022
Partnered with 9 publishers and 3 state education agencies, conducted a National Teacher Survey, released Science Guidelines, and support grew to merit becoming an independent nonprofit.
2024
Launched Benchmarks of Quality and Spanish Language Arts Guidelines, grew forum to over 50+ scholars, practitioners, and experts to provide services and support the development of ELSF’s resources.