Basic proof of concept for a dialog created in javascript and then how to handle results from dialog.
Also showcase some more advanced usage and some pitfalls.
Basic proof of concept for a dialog created in javascript and then how to handle results from dialog.<br>
Also showcase some more advanced usage and some pitfalls.
<hr>
<button onclick="showDialog();">showDialog()</button> Open a dialog; reopens previous one if any.<br>
<button onclick="showNewDialog();">showNewDialog()</button> Create a new one.<br>
<div id="result">
<h2>dialog form submit result:</h2>
dialog.returnValue = <code id="result_returnvalue"></code><br>
<br>
FormData to simple object to json:
<pre id="result_json"></pre>
</div>
<hr>
links:<br>
<a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog">MDN dialog</a><br>
<a target="_blank" href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement/returnValue">MDN dialog.returnValue</a><br>
<a target="_blank" href="https://jsfiddle.net/ElMoonLite/pjn8btqm/">jsfiddle multiple dialogs experiment</a><br>
<a target="_blank" href="https://codepen.io/geckotang/post/dialog-with-animation">fancy dialog css with animation</a><br>