Click to See Complete Forum and Search --> : I'm doing something wrong and I have no clue


spaceplane
02-10-2003, 05:41 PM
I usually don't code in javascript I got to do a date validation that take a starting date in 3 combobox one for the day one for the month and one for the year and a ending date that will have the same 3 combo box I want that on each change of a combo box it check that the ending date is after the starting dsdate and f not it change the ending date to the same date as the starting date.

I did attach my web page with it my problem is written in the code in comments I just don't really know javascript
thanks

spaceplane
02-10-2003, 08:01 PM
oops forgot to put the code
if (document.Form1.FirstSelectYear.value == document.Form1.EndSelectYear.value)
{
if (document.Form1.FirstSelectMonth.value == document.Form1.EndSelectMonth.value)
{

if (document.Form1.FirstSelectDay.value < document.Form1.EndSelectDay.value)
{
document.Form1.EndSelectDay[document.Form1.FirstSelectDay.value].selected = true;
}
}
else
{
if (document.Form1.FirstSelectMonth.value < document.Form1.EndSelectMonth.value)
{
document.Form1.EndSelectMonth[document.Form1.FirstSelectMonth.value].selected = true;
document.Form1.EndSelectDay[document.Form1.FirstSelectDay.value].selected = true;
}
}
}
else
{
if (document.Form1.FirstSelectYear.value < document.Form1.EndSelectYear.value)
{
document.Form1.EndSelectYear[document.Form1.FirstSelectYear.value].selected = true;
document.Form1.EndSelectMonth[document.Form1.FirstSelectMonth.value].selected = true;
document.Form1.EndSelectDay[document.Form1.FirstSelectDay.value].selected = true;
}
}
I think my problem is I don't know how to get the value from a combobox and chnage the selected one...
thank