I tried to dig out the one I did that had magic picking lists that
“knew” how many days were in each month and so forth, but I couldn’t
find it.
So after a bit of digging on Scripteka, I found a really clean and
easy-to-add one: http://calendarview.org
For a basic way to apply it in Freeway, lay out your page the way you
want it to appear. Make sure to add an ID to your date field (Freeway
will add an ID to the container DIV, but that’s not the same thing –
use the Extended dialog to make sure it attaches to the form field).
Now add the Protaculous Action to your page, and choose the prototype-
packed library. Click on one of the Function Body buttons, and paste
the following inside the dialog:
Calendar.setup({
dateField: 'date'
})
In this example, I’ve used ‘date’ as the ID of my form field. Change
this word to be exactly the same as the ID you add on your page. (You
can have more than one, just make sure that they have unique IDs, and
add an instance of the code block above for each within the same
dialog in Protaculous.)
Next, you need to add the stylesheet and the calendar script to the
page. You can try the External JavaScript Action for this, but there
may be an issue with it not getting the script high enough into the
page to have it be loaded before the script calls it. The stylesheet
can be added using the External Stylesheets Action or by hand-coding.
Here’s the code for both, just paste it into the Page / HTML Markup
dialog in the “before /head” slot, and use Upload Stuff or an FTP
application to put the files in the same folder as your page on the
server.
<script src="calendarview.js" type="text/javascript" charset="utf-8"></
script>
<link rel="stylesheet" href="calendarview.css" type="text/css"
media="screen" charset="utf-8"/>
Publish, and test it out. Click on the date field, and it should be
covered by a nice calendar centered on either whatever date you had in
the field already, or on today’s date if you left it blank.
It’s very hackable, the CSS is well written and easy to change if you
need to. I put a simple page up at <date picker
if you want to see the absolute minimum example possible.
Walter
On Dec 11, 2008, at 11:18 PM, paulvw wrote:
I saw Walter mentioning it as an example on the forum but not really
a specific description how to go about. I need a small widget that
people can click on and the date will be added on a text field - as
you see on booking forms.
If anybody has some advise how to integrate that on a FW page…
BTW: I got a nice one downloaded, but the next question is than how
to integrate that on a FW form… http://codetale.com/2007/02/23/javascript-calendar-widget/
Thanks!
Paul
freewaytalk mailing list
email@hidden
Update your subscriptions at:
List Options | FreewayTalk
freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options