You are viewing documentation for Vaadin Framework 8 and related products View documentation for Vaadin Framework 7 ›
Using Inside a Form · Vaadin
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.

<form is="iron-form" method="post">
  <vaadin-combo-box name="name" label="Element"></vaadin-combo-box>
  <button>Submit</button>
</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>