0

I am trying to get time value from bootstrap timepicker . There are two forms within a table row.

The first form is

<tr>
    <form class="form-inline" id ="form1">
        <td>
            <div class="input-group  bootstrap-timepicker timepicker">
                <input id="" type="text" class="in_timepicker form-control input-small">            
            </div>
        </td>

        <td>
            <div class="input-group  bootstrap-timepicker timepicker">
                <input id="" type="text" class="out_timepicker form-control input-small">                                
            </div>
        </td>       

        <td>
            <button class="btn btn-md btn-danger btnupdate" id="">Update</button>
        </td>
    </form>    
</tr>

and the second form is

 <tr>
     <form class="form-inline" id ="form2">                           
         <td>              
             <div class="input-group  bootstrap-timepicker timepicker">
                 <input id="" type="text" class="in_timepicker form-control input-small">                                
             </div>
         </td>

        <td>
            <div class="input-group  bootstrap-timepicker timepicker">
                <input id="" type="text" class="out_timepicker form-control input-small">                                
            </div>
        </td>

        <td>
            <button class="btn btn-md btn-danger btnupdate" id="">Update</button>
        </td>
    </form>    
</tr>

The javascript code is

 $('.in_timepicker').timepicker({

    minuteStep: 5,
    showInputs: false,
    disableFocus: true,
    defaultTime: false
});

$('.out_timepicker').timepicker({

    minuteStep: 5,
    showInputs: false,
    disableFocus: true,
    defaultTime: false
});


$("body").on("click", ".btnupdate", function () {        
    var intime = $(this).parent().siblings().children().children('.in_timepicker').val();
});

I am trying to get the intime value from both of the forms separately and I have written what i have tried but I am still not successful .Please suggest ways to do it.

Timo Salomäki
  • 7,099
  • 3
  • 25
  • 40
psyborg.eth
  • 310
  • 5
  • 18

1 Answers1

0

I initialised the timepicker using the data attribute

 <input id="" type="text" class="out_timepicker form-control input-small" data-provide="timepicker"/>
psyborg.eth
  • 310
  • 5
  • 18