Parish wrote:
> Alejandro Romero wrote:
>> OS: Windows 2000 Professional
>> Navegator: Mozilla 1.0 - Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;
>> rv:1.0.0) Gecko/20020530
>>
>> The problem:
>> I have three boxes type text and when the user press <TAB> from the
>> first box the focus should appear in the third box. The problem is that
>> appear once and then the point goes to the second (this box should be
>> unreachable). After this, I can write in the disabled box and the
>> pointer never appears in the third box. The related code for this page is:
>>
>
> If you *never* want users to be able to enter text in the second box
> would it not be better to make it a textarea rather than an input?
>
[Followup-To: set to n.p.m.browser]
Forget that. What you need is to set the disabled property to true:
Disabled box:<input type="text" name="w_text2" value="Disabled"
disabled="true">
In theory at least setting the tabindex property to 0 should prevent the
box ever getting focus, but it doesn't seem to work (on Moz or IE):
Input box:<input type="text" name="w_text1" tabindex="1" value="">
Disabled box:<input type="text" name="w_text2" value="Disabled"
tabindex="0">
Input box:<input type="text" name="w_text3" tabindex="2" value="">
causes the focus to move from the first box to the third, OK so far, but
hitting TAB when the third box has focus moves the focus to the Disabled
box - wierd.
>> <html>
>> <head>
>> <title>Problem with focus()</title>
>> <script language="JavaScript">
>>
>> function putfocus()
>> {
>> document.oForm.w_text3.focus();
>> }
>>
>> </script>
>> </head>
>> <body>
>> <form name="oForm" action="#" target="_top" method="post">
>>
>> Input box:<input type="text" name="w_text1" value="">
>> Disabled box:<input type="text"
>> name="w_text2" value="Disabled" onfocus="JavaScript:putfocus();">
>> Input box:<input type="text"
>> name="w_text3" value="">
>>
>> </form>
>> </body>
>> </html>
>>
>>
>> It is not a solution to put "disabled" in the the second box, because I
>> need to redirect the focus to a different box.
>> Could someone help me ?
>>
>> Thanks before hand
>> Alejandro
>>
>>
>
>
--
The day Microsoft stop making products that suck will be the day they
start making vacuum cleaners.
Anti-spam e-mail address, sorry for the inconvenience