DatePicker using Prototype and Scriptaculous
Until we get <input type="date" /> into the browsers, we will need to create data pickers.
DatePicker is a simple one that users Prototype and Script.aculo.us, and does the basics well (although the fade can be a touch annoying to me).
It is very simple to use too:
HTML:
-
-
<script type=“text/javascript” src=“/prototype.js”></script>
-
<script type=“text/javascript” src=“/scriptaculous.js”></script>
-
<script type=“text/javascript” src=“/datepicker.js”></script>
-
<style type=“text/css”>
-
@import("/css/datepicker.css");
-
</style>
-
<input type=“text” id=“date-from” name=“date-from” />
-
</form>
-
<script type=“text/javascript”>
-
var dpck = new DatePicker({
-
relative : ‘date-from’,
-
language : ‘en’
-
});
-
</script>
-
Of course, you could easily wrap this in a microformat so you can just do class=”date”.






