JSFiddle - React, Tailwind, and code Playground

by Avinash_R

HTML

<form class="ui-helper-hidden" title="Stupid submit form">
    <input type="text" name="name" />
</form>
<button>open</button>

JavaScript

var frm = $('form').dialog({
    autoOpen: false,
    buttons: {
        Ok: function () {
            frm.submit();
        }
    }
});

frm.submit(function (e) {
    e.preventDefault();
    console.log('submitted');
    // close the dialog and prevent it from submitting further
    // until the user specifically reopens it.
    frm.dialog('close');
    return false;
});

$('button').click(function () {
    frm.dialog('open');
});