Firstly thank you for providing this solution i.e.
onload="document.FORM1.invoiceno.focus();" in body tag.
i have provided a check to see that the focused textbox should not be empty and if it is empty user would we given an alert message.but the problem is, if i click the maximize, minimize or even close button, the message pops-up. i want that the alert message should not fire if user clicks on close, minimize and maximize button.
I have set the focus to a particular text box as soon as form loads. On the "onBlur " Event i have written a code that checks whether the field is empty or not, if empty an alert saying Field cannot be empty is fired. But this fires even when i click the close "X" button or maximize or minimize button.