UNPKG

api-console-assets

Version:

This repo only exists to publish api console components to npm

73 lines (64 loc) 2.6 kB
<!doctype html> <!-- @license Copyright (c) 2015 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt --> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes"> <title>paper-checkbox demo</title> <script src="../../webcomponentsjs/webcomponents-lite.js"></script> <link rel="import" href="../../iron-demo-helpers/demo-pages-shared-styles.html"> <link rel="import" href="../../iron-demo-helpers/demo-snippet.html"> <link rel="import" href="../../iron-form/iron-form.html"> <link rel="import" href="../paper-checkbox.html"> <style is="custom-style" include="demo-pages-shared-styles"> .vertical-section-container { max-width: 600px; } paper-checkbox { margin: 8px; } </style> </head> <body unresolved> <div class="vertical-section-container centered"> <h3>Checkboxes can be checked or unchecked, or disabled entirely</h3> <demo-snippet class="centered-demo"> <template> <paper-checkbox>Checkbox</paper-checkbox> <paper-checkbox checked>Checkbox</paper-checkbox> <paper-checkbox disabled>Disabled</paper-checkbox> </template> </demo-snippet> <h3>Checkboxes in forms passing values</h3> <demo-snippet class="centered-demo"> <template> <form is="iron-form"> <paper-checkbox name="subscribe" value="newsletetr">Subsceribe to our newsletter</paper-checkbox> <paper-checkbox name="tems" value="accepted" checked>Agree to terms and conditions</paper-checkbox> </form> <button onclick="submitForm()">Submit</button> <div> <code id="formValues"></code> </div> <script> function submitForm() { var form = document.querySelector('form[is="iron-form"]'); var values = form.serialize(); document.querySelector('#formValues').innerText = JSON.stringify(values, null, 2); console.log(values); } </script> </template> </demo-snippet> </div> </body> </html>