You are viewing documentation for Vaadin Framework 8 and related products View documentation for Vaadin Framework 7 ›
Using Inside a Form · Vaadin
Vaadin Elements - Date Picker - Using Inside a Form

Using Inside a Form

The vaadin-date-picker implements the IronFormElementBehavior, so it can be used as a field in an iron-form.

<form is="iron-form" action="">
  <vaadin-date-picker name="date" label="Pick a date"></vaadin-date-picker>
  <input type="submit">
</form>
<script>
  var form = document.querySelector('form');
  var combobox = document.querySelector('vaadin-date-picker');

  form.addEventListener('iron-form-submit', function() {
    alert('Form submitted with date: ' + form.serialize().date);
    return false;
  });
</script>