add wizard

This commit is contained in:
Eric Leroy-Terquem 2023-04-27 10:10:57 +02:00 committed by LeSim
parent 2e1b8b9ef2
commit 526f70f9c0
3 changed files with 27 additions and 0 deletions

View file

@ -0,0 +1,14 @@
import { Controller } from '@hotwired/stimulus';
export class RadioEnabledSubmitController extends Controller {
static targets = ['submit'];
declare readonly submitTarget: HTMLButtonElement;
click() {
if (
this.element.querySelectorAll('input[type="radio"]:checked').length > 0
) {
this.submitTarget.disabled = false;
}
}
}