Solved

is there a calendar i could use to auto fill in my text box

Posted on 2008-06-12
10
218 Views
Last Modified: 2012-06-21
I have a web page in php that collects data from usrs and stores the data in my database.  I have to text boxes that I would like to add calenders to so the usr could select the calendar and have the dates populate to my text feild.  How can I do this. Thanks

here is my current text feilds
td><input name="DateRevoked" type="text" value="" size="15" maxlength="10" />
(yyyy/mm/dd)</td>
td><input name="CompletionDate" type="text" value=""/>(yyyy/mm/dd)</td>
0
Comment
Question by:Football33Football
  • 6
  • 4
10 Comments
 
LVL 24

Accepted Solution

by:
glcummins earned 125 total points
Comment Utility
The "Unobtrusive Date Picker Widget" is one that I have used for a while, and is very flexible and useful. You can find it here:

http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update

As I am posting this, I am having a little trouble getting that site to load, but you should be able to access it shortly.
0
 

Author Comment

by:Football33Football
Comment Utility
Ok I have two questions?
It looks like the zip file has a lot of files which ones would I need?

Also I would like to use the Single Input (static) DatePicker and it had this, but what do I acutlly have to do to get it to work? THanks
class=format-d-m-y divider-dash highlight-days-12 no-fade
0
 
LVL 24

Expert Comment

by:glcummins
Comment Utility
You will need the following directories and their contents:

 css/
 js/
 media/

The 'css' folder contains the layout information to make the calendar look pleasing. The 'js' folder contains the Javascript code. The 'media' folder contains the images that are used in the calender.

Place all of these directories in the root (top-level) directory of your website. Then in the <head> portion of the HTML file that will use the calender, include the following lines:

<link rel="stylesheet" type="text/css" href="/css/datepicker.css" />
<script type="text/javascript" src="/js/datepicker.js"></script>

This will include the correct files into your document. Now you are ready to use the script. To make the calendar control appear, simply place the class="..." line inside the <input> tag that will receive hold the date. Mine looks like this:

<input class="w8em format-y-m-d divider-dash range-low-2008-01-01 range-high-2010-12-31" name="dp-normal-1" id="edit_expiration_date" value="" type="text" />
0
 

Author Comment

by:Football33Football
Comment Utility
glcummins,
  I can't seem to get this to work, I must be doing something wrong.  When I compile the website I have what looks like a link to the calender but nothing pops up.  It's like there is now picture for the calander.

I but this in my head tag <link rel="stylesheet" type="text/css" href="/css/datepicker.css" />
<script type="text/javascript" src="/MGCWEB/js/datepicker.js"></script>
the path to where date picker is located is C:\xampp\htdocs\MGCWEB\js and my webpages begin in the path C:\xampp\htdocs\MGCWEB.  Every thing seems fine here.

in my text box i have <td><input class="w8em format-y-m-d divider-dash range-low-2008-01-01 range-high-2010-12-31" name="CompletionDate" type="text" id="CompletionDate" value="" size="15" maxlength="10" />

any ideas?
0
 
LVL 24

Expert Comment

by:glcummins
Comment Utility
The problem is likely with this line:

 <script type="text/javascript" src="/MGCWEB/js/datepicker.js"></script>


If your webpage resides in the directory 'MGCWEB', you want to change this line to:

  <script type="text/javascript" src="/js/datepicker.js"></script>

The directory 'MGCWEB' does not need to be included, because it is considered the top-level directory.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Football33Football
Comment Utility
glcummins,
I had as you suggested above and get the same thing as when I switced it to <script type="text/javascript" src="/MGCWEB/js/datepicker.js"></script>.  I don't see a picture of a calander or nothing.  I even tried pulling the calendar, css and .js file out of there folder and putting them under my MGCWEB section and still get the same promblem.

I'm not sure why I can't get it to work.  I'm using dreamweaver if that helps.  Would i need to add the css file or anything like that?
0
 

Author Comment

by:Football33Football
Comment Utility
just checking back
0
 
LVL 24

Expert Comment

by:glcummins
Comment Utility
Okay, help me to understand. Your webfiles are in the MGCWEB directory, correct? When you access your site in a browser, do you browse to :

 www.yoursite.com/MGCWEB/

or to

 www.yoursite.com

?

If you use the first method, do you have access to the folder which is above MGCWEB? Or is it unwritable to you?

This will help me to better instruct you where to place the files and which <script> tag to use.

Additionally, I would recommend a thorough reading of the documentation that comes with the datepicker script, as it is most instructive.
0
 

Author Comment

by:Football33Football
Comment Utility
yes.  my website is located at C:\xampp\htdocs\MGCWEB the files located at

after reading a little more carfully I moved my three files css/  js/  media/ on level above my MGCWEB C:\xampp\htdocs\.

I got the calander to come up but no picture of a calander is present. I can hover over where the picture should be and my cursour turns to a hand but I can't see no calander.

I do have access to the directory above MGCWEB

0
 

Author Comment

by:Football33Football
Comment Utility
Managed to get it to work. Thanks a lot for the help
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This article will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now