Solved

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

Posted on 2008-06-12
10
222 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
ID: 21773046
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
ID: 21773710
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
ID: 21773775
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
ID: 21777709
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
ID: 21778272
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Football33Football
ID: 21778528
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
ID: 21790352
just checking back
0
 
LVL 24

Expert Comment

by:glcummins
ID: 21793347
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
ID: 21798328
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
ID: 21805870
Managed to get it to work. Thanks a lot for the help
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

867 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

22 Experts available now in Live!

Get 1:1 Help Now