javascript, getelementbyname and focus
I am trying to create function that will look at the username if it is not valid send an alert to the user, clear the username field, and put the username field back into focus. I am trying to do this all with the getElementsBynName() function. It is all working with the exception of getting the field back into focus. My code is below. Does anyone have any suggestions. function uchecker(uname) { var validUname = uname.search(/^\w+@sabc.com$/); if(validUname != 0) { alert("You have entered an invalid username. \n The username must be a valid @sju.edu email address value " + document