Use of laydate and limit the size of two text boxes

Source: Internet
Author: User



First: You need to introduce jquery-1.10.2.js (version unlimited) and laydate.js files; jquery references must be in front of you, otherwise you won't get the results you want.

And then:
Code
<ID= "Start"  runat= "Server"></asp: TextBox><ID= "End"  runat= "Server"  ></asp:textbox>
    2) JS code
<script type= "Text/javascript" >        $(function () {            varStart ={elem:' #start ',//Select input with ID startFormat: ' Yyyy/mm/dd hh:mm:ss ',//Auto-generated time formatMin:laydate.now (),//set the minimum date to the current dateMax: ' 2099-06-16 23:59:59 ',//Maximum DateIstime:true,//time must be filled inIstodayfalse,//whether it is the same dayStart:laydate.now (0, "Yyyy/mm/dd hh:mm:ss"),//set the start time to the current timeChoosefunction(datas) {end.min= Datas;//The minimum date to reset the end date after the start date is selected .End.start = Datas//set the initial value of the end date to the start date                }            }; varEnd ={elem:' #end ', Format:' Yyyy/mm/dd hh:mm:ss ', Min:laydate.now (), Max:' 2099-06-16 23:59:59 ', Istime:true, Istoday:false, Start:laydate.now (0, "Yyyy/mm/dd hh:mm:ss"), choose:function(datas) {Start.max= Datas;//when the end date is selected, the maximum date to reset the start day                }            };            Laydate (start);        Laydate (end); })    </script>

The final display is:

Use of laydate and limit the size of two text boxes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.