Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gaining Focus (Netscape 6.1)

Status
Not open for further replies.

ashpassword

Programmer
Jun 19, 2002
19
IN
we are using IE 6 and NS 6.1 which we cann't change as requirement restricts.
Now the problem we are facing is after validation of any field if validation fails we select the text and set focus to that field, now this is working fine in IE and in NS it selects the field but takes focus to next field thus allowing user to enter invalid data, which we don't want.

Code we are using is for e.g.

function checkNom(txtObj)
{
//if txtObj.value fails
txtObj.select();
txtObj.focus();
return false;

}
Hope things are very clear now.
Expecting your early reply. Please don't suggest to change browser.








 
ashpassword,
you shouldn't need to use focus() if you've already used select()...try without focus() ======================================

if (!succeed) try++
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top