javascript - How should I use a window.confirm dialog box with a form? -


i have tried window.confirm on submit button saying "are sure" if click on no submits itself? wrong way of using it?

<button type="submit" class="btn btn-primary" onclick="window.confirm('are sure want transfer user?')"> transfer </button> 

use this

<form onsubmit="return confirm('are sure want transfer user?')">  </form> 

Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

qt - How to embed QML toolbar and menubar into QMainWindow -