msg2ajay
07-06-2007, 10:01 AM
hi,
Below is the code which is working for IE but not working for FF...
can any bady tel me how to set focus for FF... as shown below. The below there is to focus() where 'all' is wroking for IE and FORMS[] is not working for FF..
<html>
<head>
<script language="JavaScript">
function checkme(strVal){
var id=strVal;
alert(id);
//document.all[strVal].focus();---->(IE) FOR IE it is working but not working for mozilla firefox
document.forms[strVal].focus(); //(FIREFOX)
}
</script>
</head>
<body>
<form>
NAME..<input type="text" name="empName" size="5" maxlength="4" onChange="checkme(this.value)"/><br>
ID....<input type="text" name="id" value=""/><br>
DEPT..<input type="text" name="dept" value=""/><br>
</form>
</body>
</html>
thx,
Ajay.
Below is the code which is working for IE but not working for FF...
can any bady tel me how to set focus for FF... as shown below. The below there is to focus() where 'all' is wroking for IE and FORMS[] is not working for FF..
<html>
<head>
<script language="JavaScript">
function checkme(strVal){
var id=strVal;
alert(id);
//document.all[strVal].focus();---->(IE) FOR IE it is working but not working for mozilla firefox
document.forms[strVal].focus(); //(FIREFOX)
}
</script>
</head>
<body>
<form>
NAME..<input type="text" name="empName" size="5" maxlength="4" onChange="checkme(this.value)"/><br>
ID....<input type="text" name="id" value=""/><br>
DEPT..<input type="text" name="dept" value=""/><br>
</form>
</body>
</html>
thx,
Ajay.