Link to home
Start Free TrialLog in
Avatar of Football33Football
Football33Football

asked on

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

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>
ASKER CERTIFIED SOLUTION
Avatar of glcummins
glcummins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Football33Football
Football33Football

ASKER

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
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" />
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?
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.
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?
just checking back
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.
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

Managed to get it to work. Thanks a lot for the help