0

I am currently doing a project that includes a calendar which on clicking any date of the year will open another page to fill in certain information. The problem im having is i cant find a basic calendar anywhere with the ability to skip through to a previous or future month and be able to click on a specific date that will go to the page with the info to be entered.

Can anyone help me with a tutorial to build a calendar in javascript or PHP from scratch and has the ability to view previous or future months.

Much Appreciated

3
  • 1
    Did you tried jquery datepicker? jqueryui.com/datepicker Commented Nov 15, 2014 at 0:55
  • Had previously seen it but didnt see that it could be displayed inline. Thumbs up for the help fam Commented Nov 15, 2014 at 1:17
  • you're welcome. If you like inline date picker, you can check these basic example for learning: jquery-ui.googlecode.com/svn/tags/1.6rc4/demos/datepicker/… Commented Nov 15, 2014 at 1:23

1 Answer 1

1

Use jquery datepicker and send them to the new page using the datepicker's onSelect method:

$( ".selector" ).datepicker({ 
    onSelect: function (dateText, inst) {
         window.location = "/newpage/?date=" + dateText;
    } 
});
Sign up to request clarification or add additional context in comments.

3 Comments

Just to make sure whats the purpose of the dateText
@DamianAnthony dateText is a string which represents the date that the user chose. This is just an example of how you can send it to the new page so you can access it with the PHP on the new page by using $_GET["date"]
Lol working on the project now and just retrieved the date using this method. thanks for assistance, eventually i hope to be as great at development as you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.