Select2 demo

by dying_sakura

HTML

<script src="https://rawgit.com/select2/select2/master/dist/js/select2.js"></script>
<link rel="stylesheet" href="https://rawgit.com/select2/select2/master/dist/css/select2.min.css">
<form action="#">

  First name: <input type="text" name="FirstName" value="Mickey"><br>
  Last name: <input type="text" name="LastName" value="Mouse"><br>
  
  <select class="chosenCommon" name="fruits">
    <option value="1">Banana</option>
    <option value="2">Orange</option>
    <option value="3">Mango</option>

  </select>

  Full name: <input type="text" name="FullName" id="FullName" value="Mickey Mouse"><br>

  <input type="text" name="" id="address">

  <select class="chosenCommon" name="cities">
    <option value="1">Dhaka</option>
    <option value="2">Chittagon</option>
    <option value="3">Rajshahi</option>
    <option value="3">Khulna</option>
  </select>

  <input type="submit" value="Save" id="save_btn">
</form>

JavaScript

$('#example').select2({
  placeholder: 'Select a month'
});



$('body').on('keydown', 'input, select', function(e) {

  if (e.key === "Enter") {
    var self = $(this),
      form = self.parents('form:eq(0)'),
      focusable, next;
    focusable = form.find('input,a,select,button,textarea').filter(':visible');
    next = focusable.eq(focusable.index(this) + 1);
    if (next.length) {
      next.focus();
    } else {
      form.submit();
    }
    return false;
  }
});