Sunday, 29 November 2015

Disable WeekEnds Using JQuery DateTimePicker Asp.Net

Disable WeekEnds Using JQuery DateTimePicker  

JQuery DatetimePicker Show WeekEnds Disable Before Showing Using Asp.Net .

                         DEMO


                    Download

                  HTML Coding

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Disable WeekEnds Using JQuery DateTimePicker Asp.Net</title>

    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.4/themes/ui-lightness/jquery-ui.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script type="text/javascript" src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
      
   
    <script type="text/javascript" lang="javascript">
        $(function () {
            $("#<%=textboxDate.ClientID %>").datepicker({
                dateFormat: "dd/mm/yy",
                changeMonth:true,
                beforeShowDay: function (DATE) {
                    var Week = DATE.getDay();
                    if (Week == 0 || Week == 6)
                    {
                        return [false];
                    }
                    else
                    {
                        return [true];
                    }
                }
           
            });
        });
    </script>

</head>
<body>
    <form id="form1" runat="server">
    <div>
      
        <table><tr><td>
                        <asp:Label ID="Label1" runat="server" Text="Select Date"></asp:Label>
            </td><td>
                <asp:TextBox ID="textboxDate" runat="server"></asp:TextBox>
            </td></tr></table>
    </div>
    </form>
</body>

</html>






0 comments:

Post a Comment