当序列焦点在jquery中时,未设置值

时间:2014-07-18 16:36:53

标签: javascript jquery html

当我将文本框留在字段中时,jquery会自动关注表单的下一个文本框,

但到达文本框未设置值并转到下一个出发框字段

我的代码ID

     <form name="searchForm" method="get" action="searchresult.php" class="" id="searchForm" novalidate="novalidate">
     <div class="form-horizontal" style="padding:10px;">
     <div class="form-group ">
     <label for="destiny">Destination</label>
     <input type="text" name="location" autocomplete="off" class="form-control textinput" id="destiny" onblur="dateselect1()" onKeyup="log()" placeholder="Enter Destination">
     <div id="livesearch"></div></div> 
     <div class="form-group col-sm-6"><label for="start_stayPeriod" class="control-label">Arrival</label>

     <input type="text" class="form-control textinput date-picker" name="startdate" onblur="dateselect2()"  id="datepicker1"  placeholder="dd/mm/yyyy" ></div>

    <div class="col-sm-1"></div><div class="form-group col-sm-7">
     <label for="enddate" class="control-label">Departure</label>
    <input type="text" class="form-control textinput " name="enddate"  id="datepicker2"  placeholder="dd/mm/yyyy" >   </div>
      <script>
      function dateselect1(){
      $("#datepicker1").focus();
       }
        function dateselect2(){
        $("#datepicker2").focus();
        }
       </script>
        <input class="button searchb" name="submit" onClick="return valid()"  type="submit" value="Search for hotel"/>
    </div></form>

0 个答案:

没有答案