-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
const copyButton = document.getElementById('copy-button'); const checkboxes = document.querySelectorAll('input[type="checkbox"]'); copyButton.addEventListener('click', () => { const selectedValues = []; // Loop through all checkboxes for (const checkbox of checkboxes) { // Check if the checkbox is checked if (checkbox.checked) { // Add the checkbox value to the array selectedValues.push(checkbox.value); } } // Check if any values are selected if (selectedValues.length > 0) { // Combine the selected values into a single string with newline separators const copyText = selectedValues.join('\n'); // Copy the text to the clipboard using ClipboardJS (optional) // You can install and use the ClipboardJS library for better compatibility // https://clipboardjs.com/ // const clipboard = new ClipboardJS('#copy-button'); // clipboard.copy(copyText); navigator.clipboard.writeText(copyText).then(() => { console.log('Values copied to clipboard!'); }, (error) => { console.error('Error copying values:', error); }); } else { alert('Please select at least one option to copy.'); } });