Home > Code > Javascript > Confirmation message on submit button using JavaScript

Confirmation message on submit button using JavaScript

by Spidy   on Feb 21, 2011   Category: Javascript   |  Views: 2205    |  Points: 25   |  Silver 

Whenever user submit the data, we need a confirmation (Yes/No) message before submit the data into the server. Find the below sample code for javascript confirmation message.
<asp:Button ID="SaveInfo" OnClientClick="javascript: return confirm('Are you sure you want to submit this info.?')" runat="server" Text="Submit" />

When user clicks the Submit button, confirmation message box will display with OK and Cancel button. By clicking OK to submit the data into server, clicking Cancel will stop the post back.


Post Code  |  Code Snippet Home

User Responses

No response found, be the first to review this code snippet.

Submit feedback about this code snippet

Please sign in to post feedback

Latest Posts