Sha256: 660646e72971a1f8e28c6e34e0d50e09e61ea09b8aa493ff9ac676860d56ec62

Contents?: true

Size: 1.18 KB

Versions: 2

Compression:

Stored size: 1.18 KB

Contents

<!DOCTYPE html>
<html>
<meta charset='utf-8'>
<head>
<script src="../dialog-polyfill.js"></script>
<link rel="stylesheet" type="text/css" href="../dialog-polyfill.css">
</head>
<body>

  <p>
Enter a value and submit the form. The close event will be fired and the <code>returnValue</code> of the dialog will be alerted.
  </p>

<input type="text" placeholder="Focusable pre" />

<dialog>
  <form method="dialog">
    <input type="text" placeholder="Enter value" />
    <input type="reset" value="Reset" />
    <input type="submit" value="Stuff" />
    <input type="submit" value="Done" />
    <button type="submit" value="Button Value Is Different Than Text">Button Submit</button>
    <button value="Regular Button Value">Button</button>
  </form>
</dialog>

<button id="show">Show Dialog</button>

<input type="text" placeholder="Focusable post" />


<script>
var dialog = document.querySelector('dialog');
dialogPolyfill.registerDialog(dialog);
dialog.showModal();

dialog.addEventListener('close', function() {
  var valueEl = dialog.querySelector('input[type="text"]');
  alert(dialog.returnValue);
});

show.addEventListener('click', function() {
  dialog.showModal();
});

</script>
</body>
</html>

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
cortex-0.1.3 spec/dummy/node_modules/dialog-polyfill/tests/form.html
material-rails-0.1.0 node_modules/dialog-polyfill/tests/form.html