Vaadin Elements - Combo Box - Using Inside a Form

Using Inside a Form

The <vaadin-combo-box> element implements the IronFormElementBehavior, so it can be used as a field in an iron-form.

<iron-form>
  <form method="post">
    <vaadin-combo-box name="name" label="Element"></vaadin-combo-box>
    <button>Submit</button>
  </form>
</iron-form>
<script>
  var form = document.querySelector('form');
  var combobox = document.querySelector('vaadin-combo-box');

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