Category 'Tutorials'


DatePicker with Prototype and Scriptaculous

image An interesting and useful Javascript library based sull'accoppiata Prototype and Scriptaculous allows you to add the function of DatePicker (component in ActionScript / Flash) in normal HTML TEXT INPUT.

Its characteristic Unobtrusive (not intrusive) makes it an ideal tool to expand the functionality of a site which has been previously established. To activate the DatePicker just add the class "date" in our INPUT TAG. In Javascript you can set different parameters including the overwhelming support for the Italian language.

Here is a piece of code example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
"text/javascript" src = "/prototype.js" >< / script > < script type = "text / javascript" src = "/ prototype.js"> </ script >
"text/javascript" src = "/scriptaculous.js" >< / script > < script type = "text / javascript" src = "/ scriptaculous.js"> </ script >
"text/javascript" src = "/datepicker.js" >< / script > < script type = "text / javascript" src = "/ datepicker.js"> </ script >
"text/css" > < style type = "text / css">
@ Import ("/ css / datepicker.css");
</ style >
< form >
"text" id = "date-from" name = "date-from" / > < input type = "text" id = "date-from" name = "date-from" />
</ form >
"text/javascript" > < script type = "text / javascript">
dpck var = new DatePicker ({
relative: 'date-from',
language: 'en'
});
</ script >

More ...



Stop SOPA