how to integrate custom code to capture response? | XM Community
Skip to main content

Hi everyone,

 

I wanted to create a widget for users to select a date. I was able to do that but I am unable to get Qualtrics to capture the response. 

 

Here is the custom code any advice would be most welcome!

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Date Picker Example</title> <style> body { font-family: Arial, sans-serif; padding: 20px; } </style> </head> <body> <h1>Date Picker Example</h1> <label for="datepicker">Select a Date:</label> <input type="date" id="datepicker"> <script> document.addEventListener('DOMContentLoaded', function() { // Add event listener to the date input document.getElementById('datepicker').addEventListener('change', function(event) { var selectedDate = event.target.value; console.log('Selected Date:', selectedDate); // You can perform further actions with the selected date if needed }); }); </script> </body> </html>

Be the first to reply!

Leave a Reply