You are here: How to control the tab key with onBlur « HTML « IT news, forums, messages
How to control the tab key with onBlur

Posted by Stefan Mueller on 01/27/06 01:26

In my example the focus should only jump to textbox2 when you press the tab
key if '11' is in textbox1. If the value of textbox1 is not '11' than the
focus should be set back to textbox1. That works great in IE but in Mozilla
the cursor always jumps to textbox2 if you press the tab key even if the
value is not '11'.

<html>
<body>
<script type = 'text/javascript'>

function test(object) {
if (object.value == 11) {
return (true);
}
else {
return (false);
}
}

</script>
<form name = "my_form" action = "" method = "post" accept-charset =
"iso-8859-1">
<table id = "my_table" border = "1">
<tr>
<td>
<input type = "text" name = "my_textbox1" onBlur = 'if
(!test(document.my_form.my_textbox1))
{document.my_form.my_textbox1.focus();}'>
<input type = "text" name = "my_textbox2">
</td>
</tr>
</table>
</form>
</body>
</html>

What do I do wrong?
Stefan

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация