Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id='form1'>
- <div class="form-group">
- <label>year:</label>
- <input type="text" id="year" name="date" class="form-control">
- </div>
- <div class="form-group">
- <label>month:</label>
- <input type="text" id="month" name="date" class="form-control">
- </div>
- <div class="form-group col-md-offset-5 ">
- <button class="btn btn-success " id="hide">Rechercher</button>
- </div>
- </div>
- <div id='form2'>
- <table class="table table-bordered" id="mytable">
- <tr>
- <th>date</th>
- <th>name</th>
- </tr>
- <tr>
- <td>22/01/2019</td>
- <td>salary1</td>
- </tr>
- <tr>
- <td>22/03/2018</td>
- <td>salary2</td>
- </tr>
- </table>
- </div>
- $(document).ready( function() {
- $("#form2").hide();
- var now = new Date();
- var day = ("0" + now.getDate()).slice(-2);
- var month = ("0" + (now.getMonth() + 1)).slice(-2);
- var year = now.getFullYear() ;
- $('#year').val(year);
- $('#month').val(month);
- $("#hide").click(function(){
- $("#form1").hide();
- $("#form2").show();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement