Forum Moderators: coopster

Message Too Old, No Replies

Create and embed a PHP Calender on web

Populating a text field with data from the calender

         

mvaz

3:43 pm on Jul 9, 2008 (gmt 0)

10+ Year Member



Hi
As mentioned earlier, I run a website and on it I have a page where visitors can send their wishes and messages. There is an field where the visitor need to put the date so the message is displayed on the said date.

I intend to place a calendar near the form and provide such a funcationality that instead of the users typing the date they can just click on the date in the calendar and that date to appear in the text field provided for the date.

This is for three reasons; 1. To minimise user input, 2. To prevent the user from not inputting a date that has already gone past and 3. To enable the database to be populated in the right format for the publish_date field.

Is the calendar the best way to do this or is there any other method by which this can be achieved. If the calender is one of the possibilities, could the knowledgeable guys here help me in creating one for the purpose please?

All help and assistance is highly appreciated and welcomed. – Many thanks in advance

eelixduppy

4:47 pm on Jul 9, 2008 (gmt 0)



The calender is a good idea for something like this, the only thing is, you are probably going to be writting this calendar script with JavaScript and not PHP. I know there are open-source scripts for this written in JavsScript that you can just embed right into your HTML and maybe tweak a little bit to fit your needs. Once the user selects the date in the calendar, the javascript automatically sets an input field's value to that date (make sure the input cannot be edited directly) and there you go.

So check around the web at places like [hotscripts.com...] and you'll find something that will suit your needs.

mvaz

5:36 pm on Jul 9, 2008 (gmt 0)

10+ Year Member



Thnx a lot ed, I would rather stick to php than go with javascript. As a quickfix, I would have a drop down list, one each for day, month and year and put a validation to ensure that the contatenated string is not prior to today.

g1smd

5:38 pm on Jul 9, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Make sure that the calendar cannot be infinitely indexed.

Limit spidering to a few months or a few years.

eelixduppy

5:39 pm on Jul 9, 2008 (gmt 0)



That would work, too. :)