F
fidodido
If in the textarea (textarea3), the value is not "abc", and the user
uses "Tab" to go to the next textarea (textarea4), it will alert an
error message...and the focus will return to the textarea (textarea3)
again...
It works in Internet Explorer, however in firefox it does not work?
Anyway have any ideas why & how?
Here is the source,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>Untitled Document</title>
</head>
<script>
function checkMe(id)
{
obj = document.getElementById(id);
if (obj.value != "")
{
var text = "abc";
if (obj.value != text)
{
alert("WRONG!!!")
obj.focus();
obj.select();
}
}
}
</script>
<body>
<table width="200" border="0">
<tr>
<td><textarea id="textarea3" name="textarea3"
onblur="checkMe('textarea3')"></textarea>
</td>
<td><textarea id="textarea4" name="textarea4"
onblur="checkMe('textarea4')"></textarea></td>
</tr>
</table>
</body>
uses "Tab" to go to the next textarea (textarea4), it will alert an
error message...and the focus will return to the textarea (textarea3)
again...
It works in Internet Explorer, however in firefox it does not work?
Anyway have any ideas why & how?
Here is the source,
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"
/>
<title>Untitled Document</title>
</head>
<script>
function checkMe(id)
{
obj = document.getElementById(id);
if (obj.value != "")
{
var text = "abc";
if (obj.value != text)
{
alert("WRONG!!!")
obj.focus();
obj.select();
}
}
}
</script>
<body>
<table width="200" border="0">
<tr>
<td><textarea id="textarea3" name="textarea3"
onblur="checkMe('textarea3')"></textarea>
</td>
<td><textarea id="textarea4" name="textarea4"
onblur="checkMe('textarea4')"></textarea></td>
</tr>
</table>
</body>