Categories
Other Sections
Compatibility
|
![]() |
FF1+ IE5+ Opr7+
Jason's Date Input CalendarAuthor: Jason Moon | Homepage
Description: Jason's Date Input Calendar is designed specifically to make entering date values into forms as easy as can be! It's different from most other similar scripts in the following two ways:
In other words, this script takes the hassle out of not only selecting a date inside forms, but creating the appropriate HTML and packaging that value for easy passing as well! Other features of this script are:
The script works in all modern browsers- IE5+, NS6/ Firefox, Opera 7+. Nice! Demo:
Step 1: Insert the below into the <HEAD> section of your page: The above references an external .js file. Download calendarDateInput.js (by right clicking, and selecting "Save As"), and upload to your webpage directory. It also uses 3 images, which you should download by right clicking, and selecting "Save As":
Step 2: Once the above script is added, adding a popup Calendar field to your form is a one step process. Take a look at the below example: <form> The result is:
As you can see, simply by including function "DateInput()" in the desired place inside your form, the script will auto generate the appropriate HTML and corresponding popup calendar for it. It will also create a hidden field using your designated name (in this case, "orderdate") containing the selected date's value. Click on the form button to look inside this hidden field at any time. Additional InformationBelow describes function "DateInput()" in detail, which you need to understand to take full advantage of this script: DateInput(DateName, Required*, DateFormat*, DefaultDate*) All parameters with a * are optional, and if not passed in a value, the default value is used.
With that in mind, here are a few examples: <script>DateInput('birthdate')</script> <script>DateInput('orderdate', true)</script> <script>DateInput('todaydate', true, 'DD-MON-YYYY')</script> <script>DateInput('todaydate', true, 'DD-MON-YYYY', '28-JUN-2003')</script> -Customizable variables Inside the .js file you downloaded, there are also a few variables at the top you can customize:
|