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
  • I am beginer I try use jquery confirm function but withnout succes Jun 26, 2014 at 16:34

1 Answer 1

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.