By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,962 Members | 1,889 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,962 IT Pros & Developers. It's quick & easy.

Advancing Text Field Focus with the Period key besides TAB; IE vs firefox

P: n/a
Hi All,

I would like to use Period Key(.) besides Tab to toggle from one
textbox to another when user is editing IP addresses, which have four
textboxes. The function in below works fine with IE5, but it has
strange problem with Firefox 1.5.0.8.

<!--
<td>IP Address
<input type="text" size="3" maxlength="3" name="ip_1"
onkeypress="return focusNext(this.form,'ip_2',event)">.
<input type="text" size="3" maxlength="3" name="ip_2"
onkeypress="return focusNext(this.form,'ip_3',event)">.
<input type="text" size="3" maxlength="3" name="ip_3"
onkeypress="return focusNext(this.form,'ip_4',event)">.
<input type="text" size="3" maxlength="3" name="ip_4"
onkeypress="return focusNext(this.form,'ip_4',event)">
</td>
-->

function focusNext(form, elemName, evt)
{
evt = (evt) ? evt : event;
var charCode = (evt.charCode) ? evt.charCode : ((evt.which) ?
evt.which : evt.keyCode);
if (charCode == 46) {
form.elements[elemName].focus( );
return false;
}
return true;
}
// source from <<Javascript and DHTML Cookbook>>

If you try with Firefox, besides focusing to next textbox, the period
is wrongly kept in previous one.

Thanks for any help

Henry

Nov 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
ASM
he*******@gmail.com a écrit :
Hi All,

I would like to use Period Key(.) besides Tab to toggle from one
textbox to another when user is editing IP addresses, which have four
textboxes. The function in below works fine with IE5, but it has
strange problem with Firefox 1.5.0.8.
no problemo with Firefox 2 (on Mac)

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
Nov 21 '06 #2

P: n/a

ASM wrote:
he*******@gmail.com a écrit :
Hi All,

I would like to use Period Key(.) besides Tab to toggle from one
textbox to another when user is editing IP addresses, which have four
textboxes. The function in below works fine with IE5, but it has
strange problem with Firefox 1.5.0.8.

no problemo with Firefox 2 (on Mac)
Thanks.
Does anyone have the same on Firefox 1.5 on window?

Nov 22 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.