virtual and physical keyboards ENTER not executing form

180 views Asked by At

having a bizarre issue. I have two forms on a single page. Each form has a single input field. While focus is on the input field in form1, the key within the virtual keyboard and physical keyboard as well as the clickable "SET" button all submit the form.

However, on the second form only the clickable "SET" button will submit the form - and instead of submitting the form while the virtual and physical keyboard buttons clear the input field.

What am I missing here? Why isn't the second form being submitted upon pressing the virtual keyboard or physical keyboard key...why is it clearing the input field? :

    <form id="form1" action="#" onsubmit="setPickup(this.map_pickupInput.value); return false" style="width:360px;">
     <div class="item item-input-inset">
      <label id="map_itemLabel" class="item-input-wrapper">
        <span id="map_pickupSpan">Pickup:</span> <input type="text" id="map_pickupInput">
      </label>
      <button id="map_setStartButton" type='submit' form='form1' value='submit' class="button button-small">
        Set
      </button>
     </div>
    </form>

    <div id="map" data-tap-disabled="true"></div>

    <form id="form2" action="#" onsubmit="setDropoff(this.map_dropoffInput.value); return false" style="width:360px;">
     <div class="item item-input-inset">
          <label id="map_itemLabel" class="item-input-wrapper">
            <span id="map_dropoffSpan">Dropoff: </span><input type="text" id="map_dropoffInput">
          </label>
          <button id="map_setEndButton" type='submit' form='form2' value='submit' class="button button-small">
            Set
          </button>
        </div>
    </form>

I thought it might an ordering thing...like the first form and its fields are bound to the keyboard. But I reversed the forms and put form2 first, but the problem remained, form2 keystrokes do not submit the form.

0

There are 0 answers