Recent searches


No recent searches

Zendesk Form: Customizing Submit Confirmation Pop-up

Answered


Posted Feb 07, 2024

Our current challenge involves editing the Zendesk form, specifically working with the code snippet "request_form wysiwyg=true." We're aiming to create a submit confirmation pop-up that displays the user's input and gives them the option to double-check before finalizing. 

Has anyone successfully customized the Zendesk form using the "request_form wysiwyg=true" code snippet? Are there specific files or sections I should focus on when attempting to customize this aspect?


0

2

2 comments

image avatar

Brandon (729 Test)

Zendesk LuminaryUser Group LeaderThe Humblident Award - 2021Community Moderator

Hey Brittany Loy -

For that you're gonna need to customize the script.js file.

<script>
document.addEventListener("DOMContentLoaded", function() {
    const requestForm = document.querySelector('form'); // Adjust selector as necessary
    requestForm.addEventListener('submit', function(e) {
        e.preventDefault(); // Prevent form from submitting immediately

        // Collect user inputs (adjust selectors based on your form fields)
        const userInput = {
            name: document.querySelector('input[name="name"]').value, // Example for name
            email: document.querySelector('input[name="email"]').value, // Example for email
            // Add other fields as necessary
        };

        // Create confirmation message
        const confirmationMessage = `Please confirm your details:\nName: ${userInput.name}\nEmail: ${userInput.email}\n...`; // Add all necessary details

        // Show confirmation pop-up
        if (confirm(confirmationMessage)) {
            // User confirmed, submit form
            requestForm.submit();
        } else {
            // User canceled, do nothing
        }
    });
});
</script>

Hope this points you in the right direction!

Brandon

0


This works however after the popup appears it does not create a zendesk ticket unless you are logged in. But without the popup it does not require the user to be logged in and it will create a zendesk ticket. I am not sure why this is happening because the user is not required to be logged into zendesk for the form to be submitted. 

0


Please sign in to leave a comment.

Didn't find what you're looking for?

New post