Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Set predefault current date in datebox

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 805
    Comment on it

    How to set pre default current date in datebox before choose any other new date:

    We have to follow following steps.

    Step 1:- Download below 2 files.

    1. jquery.datepick.js
    2. jquery.datepick.css

    Call both file in HTML head

    <link type="text/css" href="jquery.datepick.css" rel="stylesheet">
     <script type="text/javascript" src="jquery.datepick.js"&gt;&lt;/script>
    

    Step 2:- Call below java script function on run time:-

    <script type="text/javascript"
            $(function(){
                $('.datePicker').datepick();
                 var myDate = new Date();
                var prettyDate =(myDate.getMonth()+1) + '/' + myDate.getDate() + '/' +
                myDate.getFullYear();
                $(".datePicker").val(prettyDate);
             });
      </script>
    

    Step 3:-

    Add input text box in HTML code where display calendar.

    <input type="text" class="datePicker">
    

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: