Apply for Credit Card - Debt Consolidation - Debt Consolidation - Debt Consolidation - Debt Consolidation

PDA

View Full Version : Calendar Input


whirlybird20
Jul 4th 2008, 3:08 am
I am trying to use this calendar input javascript, but I can't understand how to make the day display before the month. http://www.dynamicdrive.com/dynamicindex7/jasoncalendar.htm

Can anyone else figure this out?

Thanks!

Joel

=Messa=
Jul 4th 2008, 2:27 pm
You need to modify calendarDateInput.js file.

Replace this @ lines 568-583:

writeln('<select class="calendarDateInput" id="' + DateName + '_Month_ID" onChange="' + DateName + '_Object.changeMonth(this)">');
if (!Required) {
var NoneSelected = (DefaultDate == '') ? ' selected' : '';
writeln('<option value=""' + NoneSelected + '>' + UnselectedMonthText + '</option>');
}
for (var i=0;i<12;i++) {
MonthSelected = ((DefaultDate != '') && (eval(DateName + '_Object.picked.monthIndex') == i)) ? ' selected' : '';
writeln('<option value="' + i + '"' + MonthSelected + '>' + MonthNames[i].substr(0,3) + '</option>');
}
writeln('</select>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '<td valign="middle">');
writeln('<select' + InitialStatus + ' class="calendarDateInput" id="' + DateName + '_Day_ID" onChange="' + DateName + '_Object.changeDay(this)">');
for (var j=1;j<=eval(DateName + '_Object.picked.dayCount');j++) {
DaySelected = ((DefaultDate != '') && (eval(DateName + '_Object.picked.day') == j)) ? ' selected' : '';
writeln('<option' + DaySelected + '>' + j + '</option>');
}
writeln('</select>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '<td valign="middle">');

With this @ lines 568-583:

writeln('<select' + InitialStatus + ' class="calendarDateInput" id="' + DateName + '_Day_ID" onChange="' + DateName + '_Object.changeDay(this)">');
for (var j=1;j<=eval(DateName + '_Object.picked.dayCount');j++) {
DaySelected = ((DefaultDate != '') && (eval(DateName + '_Object.picked.day') == j)) ? ' selected' : '';
writeln('<option' + DaySelected + '>' + j + '</option>');
}
writeln('</select>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '<td valign="middle">');
writeln('<select class="calendarDateInput" id="' + DateName + '_Month_ID" onChange="' + DateName + '_Object.changeMonth(this)">');
if (!Required) {
var NoneSelected = (DefaultDate == '') ? ' selected' : '';
writeln('<option value=""' + NoneSelected + '>' + UnselectedMonthText + '</option>');
}
for (var i=0;i<12;i++) {
MonthSelected = ((DefaultDate != '') && (eval(DateName + '_Object.picked.monthIndex') == i)) ? ' selected' : '';
writeln('<option value="' + i + '"' + MonthSelected + '>' + MonthNames[i].substr(0,3) + '</option>');
}
writeln('</select>' + String.fromCharCode(13) + '</td>' + String.fromCharCode(13) + '<td valign="middle">');

whirlybird20
Jul 5th 2008, 3:17 am
Thank You!