Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Javascript HTML jQuery , +
I created a form using HTML and JQuery but it didn't give me the result and I couldnot able to find an error in here. Please try to solve my question and my source code will be ststed at the below!
 
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Entering Date Using the Calender Controller</title>
    <link rel="stylesheet" type="text/css" href="\jqu\css\dark-hive\jquery-ui-1.8.23.custom.css" />
    <script type="text/javascript" src="jqu\js\jquery-1.8.0.min.js">
    </script>
    <script type="text/javascript" src="jqu\js\jquery-ui-1.8.23.custom.min.js"></script>
    
    <script type="text/javascript">
 
        $("document").ready(function(){
            $("datepickerID").datepicker({
              changeyear: true,
            
            })
            
        });
        
        
    </script>
    
</head>
<body>
    <form id="form1" name="form1" action="" method="post" >
        Today is : <input type="text" id="datepickerID" name="datepickerID" />        
        
        
        
    </form>
</body>
</html>
 

Posted 12-Sep-12 21:48pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Try this code.
 
            <script type="text/javascript">
 
        $("document").ready(function(){
            $("#datepickerID").datepicker()
            
        });
        
        
    </script>
  Permalink  
v2
Comments
Chiranthaka Sampath at 13-Sep-12 5:47am
   
Ok my calender now is showing correctly but I cannot change the month or the year still! How can I do that?
joje1985 at 13-Sep-12 5:53am
   
check the improved solution.
Chiranthaka Sampath at 13-Sep-12 7:11am
   
I cannot change still the year or the month even using the improved solution
Bryian Tan at 15-Sep-12 23:29pm
   
It should work, did you use all the codes provided by ShotDriller? Is the year and month dropdownlist showing? or gray out? not selectable?
Chiranthaka Sampath at 17-Sep-12 1:23am
   
I have use all the code provided by the ShotDriller but gives the same result!
Chiranthaka Sampath at 17-Sep-12 2:03am
   
Ok guys ultimately I found all the solutions for my problems & thanks for the help! By the way the error was to when not enable to edit the year and the month was that I had typed <pre>changeyear , & changemonth , </pre> <pre>instead of chnageYear , & changeMonth,</pre>
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <title>Entering Date Using the Calender Controller</title>
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/themes/pepper-grinder/jquery-ui.css" />
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.17/jquery-ui.min.js"></script>
    <script type="text/javascript">
        $("document").ready(function() {
        $("#datepickerID").datepicker({
        changeMonth: true,
        changeYear: true
        })
    });
    </script>
</head>
<body>
    <form id="form1" name="form1" action="" method="post">
    Today is :
    <input type="text" id="datepickerID" name="datepickerID" />
    </form>
</body>
</html>
  Permalink  
v2
Comments
Chiranthaka Sampath at 14-Sep-12 3:22am
   
But pal I cannot change the month or year?
Chiranthaka Sampath at 14-Sep-12 10:41am
   
Ok I got some sort of solution but my point is if I am using jqueryui.com's datepicker how would I able to change the year and the month
ShotDriller at 14-Sep-12 10:54am
   
The thing is my code is Using "jqueryui.com's datepicker". If you have misunderstood the References i was using please refer the Complete Example section JQuery references
:
http://docs.jquery.com/How_jQuery_Works

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 Sergey Alexandrovich Kryukov 329
2 Afzaal Ahmad Zeeshan 264
3 BillWoodruff 235
4 CPallini 195
0 OriginalGriff 5,560
1 DamithSL 4,476
2 Maciej Los 3,942
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,175


Advertise | Privacy | Mobile
Web01 | 2.8.141216.1 | Last Updated 14 Sep 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100