skip to Main Content

Javascript – sweetalert and form submit

I have a form and I want to trigger an alert (using sweetalert) on submit: <form id="verbale" class="verbale" action="editor_conferma.php" method="post"> ... <input id="go" type="submit" name="go" value="go" class="swa-confirm"> </form> <script> $(document).on("submit", ".swa-confirm", function (e) { e.preventDefault(); var $myForm = $('.verbale'); if…

VIEW QUESTION

Reactjs – Form onSubmit isn't triggered

"use client"; import React, { useState } from "react"; import { useRouter } from "next/navigation"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { z } from "zod"; import { api } from "@/trpc/react"; import…

VIEW QUESTION

Stop PHP from clearing a form

I have 2 questions: How do you stop a PHP script from erasing the form fields when you do the submit? I've searched many posts here, most regarding JS which I'm not using. I've tried auto-complete="new-password" but that didn't appear…

VIEW QUESTION

jQuery – submit form after preventdefault

I've looked at lots of suggestions but none of them are working for me. The form has two submit buttons, one for add .add and the other for cancel .cancel <input type="submit" name="submit" value="Add" class="add"> <input type="submit" name="submit" value="Cancel" class="cancel">…

VIEW QUESTION
Back To Top
Search