select() question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • chirs

    #1

    select() question

    Hi,

    I want to maked 2nd box selected when the user leaves the box. But I
    cannot enter anything into the first and 3rd boxes. Does the code
    cause an infinite loop?

    <HTML><HEAD></HEAD>
    <BODY><form name="f">
    <input type=text name="n1">+
    <input type=text name="n2" onBlur="n2.sele ct()" >=
    <input type=text name="sum" >
    </form></BODY></HTML>

    Thanks.

    Chris
  • Michael Winter

    #2
    Re: select() question

    chirs wrote on 01 Dec 2003:
    [color=blue]
    > I want to maked 2nd box selected when the user leaves the box.
    > But I cannot enter anything into the first and 3rd boxes. Does
    > the code cause an infinite loop?
    >
    > <HTML><HEAD></HEAD>
    > <BODY><form name="f">
    > <input type=text name="n1">+
    > <input type=text name="n2" onBlur="n2.sele ct()" >=
    > <input type=text name="sum" >
    > </form></BODY></HTML>[/color]

    Yes, because selecting the contents brings focus to the text box. As
    you do this unconditionally (that is, /every/ time the user leaves
    that text box) the cycle cannot end. What is the point in doing this,
    anyway? It makes no sense.

    Mike

    --
    Michael Winter
    M.Winter@blueyo nder.co.uk.invalid (remove ".invalid" to reply)

    Comment

    Working...