Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #13415
| From | "Jonathan N. Little" <lws4art@gmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript, alt.html |
| Subject | Re: Clicking on Disabled Controls: What Happens? |
| Date | 2012-04-16 13:44 -0400 |
| Organization | LITTLE WORKS STUDIO |
| Message-ID | <jmhlom$s5h$1@dont-email.me> (permalink) |
| References | <lltgo7df68osn800egpq0ulqd0vna9srlm@4ax.com> <vlpio79tish13t14pvm0l24v1sd9abpnaf@4ax.com> <d45no7dqm4ut169sh5lt5dbja5unfj9d40@4ax.com> <ssmno7def1lu4a66m4beoq9r7c8kkcgdld@4ax.com> <f7hoo75f071t4r9pimg1mrkfnvgarjfh8t@4ax.com> |
Cross-posted to 2 groups.
Gene Wirchenko wrote:
> On Mon, 16 Apr 2012 18:52:52 +1000, Jeff North<jnorthau@yahoo.com.au>
> wrote:
>
>> On Sun, 15 Apr 2012 20:51:42 -0700, in comp.lang.javascript Gene
>> Wirchenko<genew@ocis.net>
>> <d45no7dqm4ut169sh5lt5dbja5unfj9d40@4ax.com> wrote:
>>
>>> | On Sat, 14 Apr 2012 23:58:59 +1000, Jeff North<jnorthau@yahoo.com.au>
>>> | wrote:
>
> [snip]
>
>>> |>You need to tell the browser which control is to have focus.
>>> |
>>> | First, I need to detect that I have to.
>>
>> Incorrect. YOU need to keep track of what controls have the focus so
>> you can return to it if there is an error or such.
>
> I do keep track of it. What I need to detect is that a disabled
> item has been clicked on. Then, I could shift focus back. I
> currently know of no way to detect this.
IF it is disabled it cannot obtain focus so you "detect" it by detecting
the focus is *not* on it.
>
>>> | The onfocus for the
>>> | disabled control (if it is a control that is clicked on) does not
>>> | fire.
>>
>> And that is standard GUI practice. If you think about it, why should a
>> disabled control react to anything because if it did then it wouldn't
>> be disabled.
>
> Exactly, but the focus still shifts. It would make more sense to
> me if clicking on something disabled did not case a focus shift. Think
> about it for a moment. If something is disabled, why should it do
> anything?
It shifts but not to the disabled control. Use tab or click and see for
yourself:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>template</title>
<script type="text/javascript">
function announce(me){
var msg=document.getElementById('status');
msg.firstChild.nodeValue='Focus on ' + me.id;
}
</script>
</head>
<body>
<form>
<ul>
<li id="status">Status</li>
<li>
<label>foo</label>
<input type="text" name="foo" id="foo" onfocus="announce(this)">
</li>
<li>
<label>bar</label>
<input type="text" name="bar" id="bar" disabled onfocus="announce(this)">
</li>
<li>
<label>baz</label>
<input type="text" name="baz" id="baz" onfocus="announce(this)">
</li>
<li>
<label>bin</label>
<input type="text" name="bin" id="bin" onfocus="announce(this)">
</li>
</ul>
</form>
</body>
</html>
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-13 12:12 -0700
Re: Clicking on Disabled Controls: What Happens? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-14 10:35 +0000
Re: Clicking on Disabled Controls: What Happens? Denis McMahon <denismfmcmahon@gmail.com> - 2012-04-14 15:45 +0000
Re: Clicking on Disabled Controls: What Happens? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-14 17:39 +0000
Re: Clicking on Disabled Controls: What Happens? Denis McMahon <denismfmcmahon@gmail.com> - 2012-04-14 20:59 +0000
Re: Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-15 20:26 -0700
Re: Clicking on Disabled Controls: What Happens? "Evertjan." <exjxw.hannivoort@interxnl.net> - 2012-04-16 09:37 +0000
Re: Clicking on Disabled Controls: What Happens? Jeff North <jnorthau@yahoo.com.au> - 2012-04-14 23:58 +1000
Re: Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-15 20:51 -0700
Re: Clicking on Disabled Controls: What Happens? Jeff North <jnorthau@yahoo.com.au> - 2012-04-16 18:52 +1000
Re: Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-16 09:25 -0700
Re: Clicking on Disabled Controls: What Happens? "Neil Gould" <neil@myplaceofwork.com> - 2012-04-16 13:13 -0400
Re: Clicking on Disabled Controls: What Happens? Tim Streater <timstreater@greenbee.net> - 2012-04-16 18:32 +0100
Re: Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-16 10:53 -0700
Re: Clicking on Disabled Controls: What Happens? "Jonathan N. Little" <lws4art@gmail.com> - 2012-04-16 13:44 -0400
Re: Clicking on Disabled Controls: What Happens? Stefan Weiss <krewecherl@gmail.com> - 2012-04-15 00:33 +0200
Re: Clicking on Disabled Controls: What Happens? Denis McMahon <denismfmcmahon@gmail.com> - 2012-04-15 00:00 +0000
Re: Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-15 20:27 -0700
Re: Clicking on Disabled Controls: What Happens? Gene Wirchenko <genew@ocis.net> - 2012-04-15 20:24 -0700
csiph-web