Setting main window position (JS)
Basically my problem is that I have a textbox where a user enters a mark (for example 20/50). If the mark is great than the max (50 in this case) it gives an alert box and then deletes the mark, that part is fine.
But if someone uses tabs to go through forms, then after the alert has taken place the user will still scroll down to the next box for marking. What I'd like to do is to go back to the box which was wrong for changes instead.
So I thought I'd find a way to move the window back up to that box. Here is my code to mark the form:
function checkMark(mark,max)
{
if(mark.value>document.getElementById(max).value)
{
alert("The mark you entered was higher than the maximum mark.");
mark.value="";
mark.focus();
}
}
Remember this is not a sub-window opened using window.open, this is just the web page itself.
Edited: Found out that this only happens in Firefox, IE 7+Opera are ok.

