0 Replies - 301 Views - Last Post: 25 April 2019 - 10:23 AM Rate Topic: -----

#1 ikhlas_06   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 21-June 18

Date Range Picker on asp:textbox

Posted 25 April 2019 - 10:23 AM

i am using vb .net, javascript, css

below is a date ranger picker, which i found on google.



<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<script>
    $(function () {
        $('input[class="daterange"]').daterangepicker({
            opens: 'left'
        }, function (start, end, label) {
            console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
        });
    });
</script>
<input type="text" class="daterange" value="01/01/2018 - 01/15/2018" />




issue is that I am using vb.net and textbox rather than input field.
how can i input field into textbox?


<script type="text/javascript" src="https://cdn.jsdelivr.net/momentjs/latest/moment.min.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css" />
<script>
$(function () {
$('input[class="daterange"]').daterangepicker({
opens: 'left'
}, function (start, end, label) {
console.log("A new date selection was made: " + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
});
});
</script>

<asp:TextBox ID="DateRangeID" placeholder="mm/dd/yyyy - mm/dd/yyyy" class="daterange form-control input-md " runat="server"></asp:TextBox>

forgot to add code tags.... it is not letting me edit my topic

new to javascript.. but found the answer


$('.daterange').daterangepicker({



Is This A Good Question/Topic? 0
  • +

Page 1 of 1