In a multi-step form, visitors usually have to click a button to move to the next step. If a step only has a radio button question, you can advance them automatically as soon as they make a choice.
Add the JS callback
Open your campaign in the builder.
In the left menu, select JS callbacks.
Create a new callback linked to the Before popup display event.
Paste the following code:
const form = event.target.querySelector('.wisepops-content form');
if (form) {
form.addEventListener('input', (event) => {
if (event.target.type === 'radio' && event.target.value !== undefined) {
const cta = form.querySelector('button');
if (cta) {
cta.click();
}
}
});
}Save your campaign.
When a visitor selects a radio option, the code clicks the step's button for them.
Hide the button (optional)
If every step in your form only has radio questions, you can hide the button completely with this CSS:
.wisepops-block-signup button {
display: none;
}Only use this if all your steps are radio-only. If a step has other field types, like text or email, visitors will need the button to continue.
Test it
JS callbacks don't run in the campaign editor. Use a live preview on your website to check that it works.
