Hi.
how do I set focus if Im expecting that priority is always 1 char of length while country is always 3 char of length.
If I entered country next textbox should be company_name AND if I entered Priority next textbox should be Exchange.
Currently if I enter EITHER COUNTRY OR PRIORITY next textbox always focus on company_name. WHATS WRONG WITH MY CODE.


my script is as shown below:

<script language="javascript">
IF (DOCUMENT.FORM1.PRIORITY.VALUE.length=1)
{function doOnLoad() {
document.Form1.EXCHANGE.focus();}
}

ELSE
IF (DOCUMENT.FORM1.COUNTRY.VALUE.length=3)
{function doOnLoad() {
document.Form1.COMPANY_NAME.focus(); }
}
</script>


please help !!!!

thanks in advance
kazam35