Skip to content

Commit 2f5c2f1

Browse files
committed
Use form.requestSubmit() to programmatically trigger form submission.
1 parent 2247cdc commit 2f5c2f1

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/app/invoices/new/page.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,14 @@ export default function NewInvoicePage() {
204204
返回
205205
</Link>
206206
<button
207-
onClick={handleSubmit}
207+
type="button"
208+
onClick={() => {
209+
// Trigger form submission programmatically
210+
const form = document.querySelector('form');
211+
if (form) {
212+
form.requestSubmit();
213+
}
214+
}}
208215
disabled={createMutation.isPending}
209216
className="px-6 py-2 bg-emerald-600 text-white rounded-lg hover:bg-emerald-700 disabled:opacity-50"
210217
>

0 commit comments

Comments
 (0)