tengo este script:
Código Javascript
:
Ver original<table style="height: 100%; width: 100%;" cellspacing="0" cellpadding="0">
<tr style="height: 100%;">
<td style="vertical-align: top; text-align: left;">
<input type="text" id="cal-field-1" />
<button type="submit" id="cal-button-1">...</button>
<script type="text/javascript">
Calendar.setup({
inputField : "cal-field-1",
button : "cal-button-1",
align : "Tr"
});
</script>
</td>
<td style="vertical-align: bottom; text-align: right;">
<input type="text" id="cal-field-2" />
<button type="submit" id="cal-button-2">...</button>
<script type="text/javascript">
Calendar.setup({
inputField : "cal-field-2",
button : "cal-button-2"
});
</script>
</td>
</tr>
</table>
y quiero que cumpla funciones de este:
Código Javascript
:
Ver original<div style="float: right; margin-left: 1em; margin-bottom: 1em;"
id="calendar-container"></div>
<script type="text/javascript">
function dateChanged(calendar) {
// Beware that this function is called even if the end-user only
// changed the month/year. In order to determine if a date was
// clicked you can use the dateClicked property of the calendar:
if (calendar.dateClicked) {
// OK, a date was clicked, redirect to /yyyy/mm/dd/index.php
var y = calendar.date.getFullYear();
var m = calendar.date.getMonth(); // integer, 0..11
var d = calendar.date.getDate(); // integer, 1..31
// redirect...
window.location = "/calendario-mlb.php?id_calen="+ y +"-"+ m +"-"+ d +"";
}
};
Calendar.setup(
{
flat : "calendar-container", // ID of the parent element
flatCallback : dateChanged // our callback function
}
);
</script>
Que sucede, el primer codigo son dos input que despliegan un calendario! y el segundo es uno que al darle click a una fecha te lleva directamente a ella... quiero que despliegue el calendario y luego que al darle click a una fecha me lleve a ella...
Esos dos codigos debo implementarlos pero desconozco la manera correcta.
AYUDA POR FAVOR.