0

I have simple form in Razor and I want add confirm dialog before save or remove before post. How can I do this?

using (Html.BeginForm("Car", "Profile", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    <fieldset>
        ...
        ...
        ...
        <p class="button">
            <button type="submit" name="save">Save</button>
            <button type="submit" name="remove">Remove</button>
        </p>
    </fieldset>
}

Thanks

1 Answers1

0

You could use JQuery to prevent normal form submission and ask for confirmation, as seen here

Just give your Html.BeginForm tag an id, as seen here

Community
  • 1
  • 1
Dweth
  • 7
  • 2