<html>
<head>
<title>calendar drop downs for dynamic content</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body >
<script type="text/javascript">
<!-- Begin
<!-- This script is made for a website where a begin and end day has to be
<!-- inserted. As it's to heavy to have a refill of the dropdownboxes to check
<!-- for the the number of days in the dropdown boxes I choose for checking on
<!-- the result of the input and not on the input itself.
<!-- i choose for three input boxes instead of one field to make computation
<!-- easier afterwards. All remarks are welcom as this is my first J scrip :)
function confirmFunction() {
var menu1_inhoud,menu2_inhoud,jaar,schrikkeljaar,feb_dagen,vol_datum,vol_datumb;
var menu1_inhoudb,menu2_inhoudb,jaarb,schrikkeljaarb,feb_dagen;
if ((menu1_inhoud==4|menu1_inhoud==6|menu1_inhoud==9|menu1_inhoud==11) && menu2_inhoud >30){
message="In deze maand zijn er maar 30 dagen ! ";
message="There are only 30 days in this month";
alert(message);
}
if ((menu1_inhoud==2) && menu2_inhoud>feb_dagen){
message="In februari zijn er maar "+feb_dagen+" dagen ! ";
message="In februari are only "+feb_dagen+" days ! ";
alert(message);
}
if ((menu1_inhoudb==4|menu1_inhoudb==6|menu1_inhoudb==9|menu1_inhoudb==11) && menu2_inhoudb >30){
message="In deze maand zijn er maar 30 dagen ! ";
message="There are only 30 days in this month";
alert(message);
}
if ((menu1_inhoudb==2) && menu2_inhoudb>feb_dagen){
message="In februari zijn er maar "+feb_dagen+" dagen ! ";
message="In februari are only "+feb_dagen+" days ! ";
alert(message);
}
vol_datum=jaar;
vol_datum += (menu1_inhoud<10) ? "0"+menu1_inhoud : menu1_inhoud;
vol_datum += (menu2_inhoud<10) ? "0"+menu2_inhoud : menu2_inhoud;
vol_datumb=jaarb;
vol_datumb += (menu1_inhoudb<10) ? "0"+menu1_inhoudb : menu1_inhoudb;
vol_datumb += (menu2_inhoudb<10) ? "0"+menu2_inhoudb : menu2_inhoudb;
if (eval(vol_datumb)<eval(vol_datum)){
message="De tweede datum kan NIET kleiner zijn dan de eerste !";
message="The second date cannot be less than the first date !";
alert(message);
}
}
// End -->
</script>
<?php /* made this function for a website where i needed a lot of date entering
All the javascripts i found worked or half or didn' t allow me to 'select' the
drop downs with data from the database or weren't able to accept data from an
external source therefore...
Vandenplas fréderic, belgium, info AT conexxion DOT be
fill the arrays for the different months I still need a way to check if a date entered exists, but that is for later :)