Hi @matn1mike ,
Thanks for reaching out!
WPForms doesn’t have a built-in reset button, but you can achieve this with some custom JavaScript:
document.addEventListener('DOMContentLoaded', function() {
// Change the form ID to match your WPForms form ID
var form = document.getElementById('wpforms-form-2927');
if (form) {
var clearButton = document.createElement('button');
clearButton.type = 'button';
clearButton.innerText = 'Clear';
clearButton.class = 'custom-btn';
clearButton.style.marginTop = '10px';
clearButton.classList.add('custom-clear-button');
form.appendChild(clearButton);
clearButton.addEventListener('click', function() {
var fields = form.querySelectorAll('input, textarea, select');
fields.forEach(function(field) {
if (field.type === 'checkbox' || field.type === 'radio') {
field.checked = false;
} else {
field.value = '';
}
});
});
}
});
Since customizations like this are outside our scope of support, this is provided as a courtesy.
If this solution isn’t quite what you’re looking for or doesn’t work as expected, we highly recommend posting your customization job here.
Hope that helps!
Hi @matn1mike ,
We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.
Thanks!