Giter VIP home page Giter VIP logo

Comments (3)

fooloomanzoo avatar fooloomanzoo commented on July 4, 2024

What do you mean by it submits my form?

from datetime-picker.

fooloomanzoo avatar fooloomanzoo commented on July 4, 2024

The only thing the element does, that it implements a validation function so that iron-form can validate the input value. Submitting is part part of your implementation. Please have a look at the demo for the element in an iron-form in the demo-folder. Don't forget the name attribute.

from datetime-picker.

tandacedric avatar tandacedric commented on July 4, 2024

this is my code, i am use datetime-picker 2.9.1
`

<style is="custom-style" include="shared-styles iron-flex iron-flex-reverse iron-flex-alignment iron-flex-factors iron-positioning"> :host { display: block; } </style>
<div class="layout vertical">

  <iron-form id="form1" on-iron-form-submit="doSumit">
    <form action="/foo" method="get">
      name:
      <input name="name" value="Batman" />
      <br> job:
      <input name="job" value="Hero" />
      <br>
      <br> first day:
      <date-picker name="first" max="{{end}}" confirmed-value="{{start}}"></date-picker>
      <br> last day:
      <date-picker name="last" min="{{start}}" confirmed-value="{{end}}"></date-picker>
      <br>
      <br> last job:
      <datetime-picker name="lastjob" min="[[start]]" max="[[end]]" date="{{lastjob}}" property-for-value="datetime"></datetime-picker>
      <br> return:
      <time-picker name="return" min="[[lastjob]]" max="[[end]]" confirmed-value="{{return}}"></time-picker>
      <br>
      <br>
      <button on-click="form1submit">Submit</button>
      <button onclick="form1.validate()">Validate</button>
    </form>
    <div id="output"></div>
  </iron-form>

</div>
<script> class PageSettingSchoolYears extends Polymer.Element { static get is() { return 'page-setting-school-years'; } static get properties() { return {} } doSumit(event) { this.$.output.innerHTML = JSON.stringify(event.detail); } form1submit(event) { this.$.form1.submit(); } constructor() { super(); } ready() { super.ready(); } connectedCallback() { super.connectedCallback(); } disconnectedCallback() { super.disconnectedCallback(); } attributeChangedCallback() { super.attributeChangedCallback(); } } window.customElements.define(PageSettingSchoolYears.is, PageSettingSchoolYears); </script>

`

from datetime-picker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.