This is probably pretty easy, but I am newbie, so here goes.
How do you check a condition with javascript before a form is submitted using a submit button?

I need to make sure my users have picked an item from a dropdown box, before they go on to the next page. I've having my submit button call a function, but it seems to ignore it.

<SCRIPT language=javascript>

function fncCheckLetter()
{
if(window.formLetterData.cboLetterType.value=="")
{
// User did not select an item from the list.
alert("You must pick a valid item.");
}
}
</SCRIPT>

<INPUT id=btnSubmitLetter name=btnSubmitLetter type=submit value=Submit tabIndex=1 onClick="fncCheckLetter">

Is there a better way or do I have to do something extra with my script?