Alert confirmation box on submitting form

satheeshkumarMCA

I have a form which submits a value. When the user tries to submit the form I want to display an alert conformation box. Upon clicking OK, the value should be saved but if Cancel is clicked instead the form should display but not save the data.

@using (Html.BeginForm())
{
 @Html.TextBoxFor(model => model.MobileNo)
<input type="submit" name="name" value="Save" />
}   
D Mishra
@using (Html.BeginForm())
{
 @Html.TextBoxFor(model => model.MobileNo)
<input type="submit" name="name" value="Save" onclick="return confirm('Are you sure?')" />
}  

You can use confirm() of javascript in onclick of the button with return.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Add a confirmation alert before submitting a form

Confirmation alert box with Laravel contact form

use alert box for confirmation

Sweet alert confirmation box does not seem to be working with form

Show Confirm Alert Box before submitting the PHP Form

Request for confirmation before submitting the form

Form not submitting after bootstrap confirmation

Modal box on submitting a form

Confirmation before submitting form using jQuery

ReactJS Show confirmation before submitting a form

Form is not submiting after the sweet alert confirmation

Alert message doesn't show on submitting form

How to display alert message after submitting form

Open an alert box if form validated

JavaScript interactive form in alert box?

adding a confirmation box to form submission with image

How to redirect confirmation page after submitting form in Laravel?

Get the check box value after submitting a form

How to get a popup box after submitting a form?

on button click with confirm alert box, query submitting on cancel also

HTML/JavaScript: How to use alert when submitting a form (with queryselector)?

Showing message box (alert) after submitig form

Conditional confirm box on submitting a form based on form data

Clear the input box after submitting the form in Angular 4

Form submitting on checkbox onchange doesnt submit the last checked box

How to show a success dialog box after submitting the form in html?

How to open a bootstrap modal box after submitting a form by barcode scanner

(PHP) Javascript confirmation alert

Message (alert) asking for confirmation