for(var k=0; k<document.form1.places.length; k++)
{
if(document.form1.places[k].checked)
str += document.form1.places[k].value + "\n";
}
The above works correctly giving me the list of places I have visited.
if(document.form1.places.length == 0)
{
message += "You did not visit any places in the last one year. \n";
}
else if (document.form1.places.length == 1)
{
message += "You visited one place: \n" + str;
}
else
message += "You visited more than one place: \n" + str ;
Why does my dialog box always go to the message showing more than one place? It prints the correct
string but the initial message is always the third option. How do I correct it?