SQL PHP HTML ASP JavaScript articles and free scripts to download If you are facing any problem in viewing this page, please tell us
 

Entering date value of a calendar to a text field


We can ask our visitors to enter a date in any text field. But here it is always better to show one calendar and ask the visitor to select a date from the calendar. This will help visitors, as they can browse the calendar and decide their date by clicking it. This will also ensure that the date is automatically entered in acceptable format. You can use this in many applications where date is to be entered by the visitors. In a hotel booking form the date of arrival and departure can be entered by using calendars.

You can see demo of this script and download the code here.

Here there are three parts of the tutorial. The first part is on how to open a new window by clicking a link, and then we will learn how to display the calendar in the new window opened. In the third part we will learn how to transfer the selected date to parent window and close the calendar window.

This tutorial is noting but integration of three tutorials so it is advisable to first learn the three tutorials.

Opening a child window from parent window.
Developing a calendar script
Passing value of selected date from child calendar window to parent page.


Here is the demo

Enter you date Click here to open the calendar window

Download the two php files used for this demo here.


Further readings
Breaking the date string to get month date and year using array
PHP Date Time
PHP Date Today
PHP Date Format
Time stamp generator
Date selection drop down list box

Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
PHP Tutorials
PHP Monthly Planner
PHP Introduction
Loops & structure
Array
Date & Time
Functions
Form Handling
File Handling
Math Functions
String Functions
GD Functions
Comment Posting
Content Management
PHP & Ajax
Popular Tutorials
Drop down list
File Upload
Signup script
Member Login
Line Graph
PHP MySQL Paging
PHP Calendar
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.