Automatically fill in the calendar control after JS is selected

Source: Internet
Author: User

Recently, I was working on a Personnel Archive project. I was not very familiar with B/S at the early stage of the project and felt that I was not very confident. As I communicated with the staff of the Division, I found that, the debugging program is getting better and better, and now the confidence is multiplied, as long as you study and understand the code, the effect will come out slowly. One of the functions I need to implement when creating a Personnel Archive is to automatically fill in the text box after the date and write it to the database ,:

 

 

 

 

 


Enter the text box automatically after the date is selected:

 

 

 

 

 


Through online materials and recently learned knowledge, you can use jS to easily solve the problem. You only need to reference js to use the calendar control, which is very convenient, simple code, and flexible to use,

 

 


Reference js files in the Code:

 


 

<SPAN style="FONT-SIZE: 18px"><asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">     <script type="text/javascript" src="../js/floatframe.js"></script>     <script type="text/javascript" src="../cal/calendar.js" charset="gb2312"></script>     <script type="text/javascript" src="../cal/calShow.js" charset="gb2312"></script>     <script type="text/javascript" src="../cal/calendar-en.js" charset="gb2312"></script>     <link href="../cal/calendar-system.css" rel="stylesheet" />     <style type="text/css"></SPAN> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">    <script type="text/javascript" src="../js/floatframe.js"></script>    <script type="text/javascript" src="../cal/calendar.js" charset="gb2312"></script>    <script type="text/javascript" src="../cal/calShow.js" charset="gb2312"></script>    <script type="text/javascript" src="../cal/calendar-en.js" charset="gb2312"></script>    <link href="../cal/calendar-system.css" rel="stylesheet" />    <style type="text/css">

A lot of errors have occurred in the process of use, and filebug has been enhanced. The breakpoint debugging methods provided by various browsers have been used to regain the fun of breakpoint debugging in C/S.

 


To ensure readability, Jiang modified the content in js to make it easier for users to use:


 

<SPAN style = "FONT-SIZE: 18px"> // ** I18N Calendar. _ DN = new Array ("day", "one", "two", "three", "four", "five", "Six", "day "); calendar. _ MN = new Array ", "August", "August", "August"); // tooltips Calendar. _ TT = {}; Calendar. _ TT ["TOGGLE"] = "switching weekly display mode"; Calendar. _ TT ["PREV_YEAR"] = "last year (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["PREV_MONTH"] = "last month (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["GO_TODAY"] = "to today"; Calendar. _ TT ["NEXT_MONTH"] = "next month (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["NEXT_YEAR"] = "next year (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["SEL_DATE"] = "select date"; Calendar. _ TT ["DRAG_TO_MOVE"] = "drag"; // Calendar. _ TT ["DRAG_TO_MOVE"] = ""; Calendar. _ TT ["PART_TODAY"] = "(today)"; Calendar. _ TT ["MON_FIRST"] = "display Monday first"; Calendar. _ TT ["SUN_FIRST"] = "display Sunday first"; Calendar. _ TT ["CLOSE"] = "CLOSE"; Calendar. _ TT ["TODAY"] = "TODAY"; // date formats Calendar. _ TT ["DEF_DATE_FORMAT"] = "y-mm-dd"; Calendar. _ TT ["TT_DATE_FORMAT"] = "D, M d"; Calendar. _ TT ["WK"] = "Week"; </SPAN> // ** I18NCalendar. _ DN = new Array ("day", "one", "two", "three", "four", "five", "Six", "day "); calendar. _ MN = new Array ", "August", "August", "August"); // tooltipsCalendar. _ TT = {}; Calendar. _ TT ["TOGGLE"] = "switching weekly display mode"; Calendar. _ TT ["PREV_YEAR"] = "last year (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["PREV_MONTH"] = "last month (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["GO_TODAY"] = "to today"; Calendar. _ TT ["NEXT_MONTH"] = "next month (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["NEXT_YEAR"] = "next year (Press and hold the mouse out of the drop-down menu)"; Calendar. _ TT ["SEL_DATE"] = "select date"; Calendar. _ TT ["DRAG_TO_MOVE"] = "drag"; // Calendar. _ TT ["DRAG_TO_MOVE"] = ""; Calendar. _ TT ["PART_TODAY"] = "(today)"; Calendar. _ TT ["MON_FIRST"] = "display Monday first"; Calendar. _ TT ["SUN_FIRST"] = "display Sunday first"; Calendar. _ TT ["CLOSE"] = "CLOSE"; Calendar. _ TT ["TODAY"] = "TODAY"; // date formatsCalendar. _ TT ["DEF_DATE_FORMAT"] = "y-mm-dd"; Calendar. _ TT ["TT_DATE_FORMAT"] = "D, M d"; Calendar. _ TT ["WK"] = "Week ";


During the communication with the customer a few days ago, some date controls were not completely corrected, and some dates were displayed in English, which made Aunt and elder sister look uncomfortable, they do not understand English. They ask: What is this English? Why do they still know this ...... This problem is that we did not have a deeper understanding of the customer after doing well in the early stage. As developers, we should make it easier for our customers to understand and work, always remember: what Mr. Mi often says is the purpose of serving the people, truly using software development.

 


In the process of communication with customers, we found that the most important thing is that we are not very clear about the nature and process of their work, and sometimes the customer is not very clear about their own needs, we need to first make a simple model so that they can come up with detailed requirements based on our simple model. For ourselves, the customer's requirements often change, and the functions are not fixed (ADD) the scalability and maintainability of software is a direction of our efforts. We still need to learn how to keep the software alive (Mr Mi said this is a place for Progress ), the scalability and maintainability of Yonghe system as a whole are quite good. The real experience of communicating with customers this time is quite rewarding. A lot of knowledge is waiting for us to study and learn.


 

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.