Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
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
<?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

Try this code.
JavaScript
        <script type="text/javascript">

    $("document").ready(function(){
        $("#datepickerID").datepicker()

    });


</script>
 
Share this answer
 
v2
Comments
Chiranthaka Sampath 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 13-Sep-12 5:53am    
check the improved solution.
Chiranthaka Sampath 13-Sep-12 7:11am    
I cannot change still the year or the month even using the improved solution
Bryian Tan 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 17-Sep-12 1:23am    
I have use all the code provided by the ShotDriller but gives the same result!
XML
<?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>
 
Share this answer
 
v2
Comments
Chiranthaka Sampath 14-Sep-12 3:22am    
But pal I cannot change the month or year?
Chiranthaka Sampath 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 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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900