File tree Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Expand file tree Collapse file tree 1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ import { AstroIcon } from "~/components";
6262 name =" info"
6363 />
6464 </div >
65- <input type =" submit" value =" Submit" />
65+ <input type =" submit" value =" Submit" disabled />
6666 </fieldset >
6767 </form >
6868 </div >
@@ -109,7 +109,7 @@ import { AstroIcon } from "~/components";
109109 name =" info"
110110 />
111111 </div >
112- <input type =" submit" value =" Submit" />
112+ <input type =" submit" value =" Submit" disabled />
113113 </fieldset >
114114 </form >
115115 </div >
@@ -185,6 +185,28 @@ import { AstroIcon } from "~/components";
185185
186186 if (!form) return;
187187
188+ const reasons = form.querySelectorAll<HTMLInputElement>(
189+ "input[type='radio']",
190+ );
191+
192+ if (!reasons) return;
193+
194+ const submit = form.querySelector<HTMLInputElement>(
195+ "input[type='submit']",
196+ );
197+
198+ if (!submit) return;
199+
200+ reasons.forEach((reason) =>
201+ reason.addEventListener(
202+ "change",
203+ () => {
204+ submit.disabled = false;
205+ },
206+ { once: true },
207+ ),
208+ );
209+
188210 form.addEventListener("submit", async (e) => {
189211 e.preventDefault();
190212
You can’t perform that action at this time.
0 commit comments