aspx Tutorial

NET Articles,jQuery demo, asp.net with jQuery, online tutorial,Jquery, SilverLight, Javascript, asp.net,JSON, MVC,.NET Articles,demo, Web Services,
Advertise Here

Toolbar

Get our toolbar!

Advertize



Posted by Aamir Hasan   on Saturday, December 10, 2011 Total Views:  

This example demonstrates how to disable specific days in jQuery UI datepicker plugin, beforeShowDay option is used to enable/disable dates in jQuery UI datepicker.

Here’s an example

<html>

<head>

<title></title>

<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.7.min.js"
           type="text/javascript"></script>

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js"
            type="text/javascript"></script>

<link rel="stylesheet"
      href
="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.16/themes/dot-luv/jquery-ui.css"
            type="text/css" media="all" />

                    

<script type="text/javascript">

    $(function () {

        $("#<%= TextBox1.ClientID %>").datepicker({

            beforeShowDay: function (date) {

                var date = date.getDay();

                return [date == 1 || date == 3 ? false : true];

            }

        });

    });

</script>

</head>

<body>

    <form id="form1" runat="server">

    <div>

      <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

    </div>

    </form>

</body>

</html>

Output

Download

Disable-specific-days-in-jQuery-UI-datepicker-plugin-.aspx (1.06 kb)

See live demo

Protected by Copyscape Online Plagiarism Tool

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

Advertizement 1
Advertizement 2
Advertizement 3
Advertizement 4
Advertizement 5