Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #13210
| From | BootNic <bootnic.bounce@gmail.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Clicking on Disabled Controls |
| Date | 2012-04-04 02:31 -0400 |
| Organization | BootNic Party Make your vote count! |
| Message-ID | <20120404023145.177c2efd@bootnic.server> (permalink) |
| References | <8t2nn7tobq7196cv20msfns6hnh6mas0of@4ax.com> |
[Multipart message — attachments visible in raw view] - view raw
In article <8t2nn7tobq7196cv20msfns6hnh6mas0of@4ax.com>,
Gene Wirchenko <genew@ocis.net> wrote:
[snip]
> (I would simply like to put the focus back.)
<script type="text/javascript">
var last;
function checkDisabled(elm) {
var button = elm.querySelector('button');
if (last && button.disabled) {
last.focus();
}
last = null;
}
</script>
<style type="text/css">
[data-info] {
display: inline-block;
}
button[disabled] {
position: relative;
z-index: -1;
}
</style>
<div>
<input type="text" onblur="last=this;">
</div>
<div>
<span onclick="checkDisabled(this)" data-info="reset">
<button type="rest" disabled="disabled" onclick=
"alert('reset button clicked')">Reset</button>
</span>
</div>
<div>
<span onclick="checkDisabled(this)" data-info="submit">
<button type="submit" onclick=
"alert('submit button clicked')">Submit</button>
</span>
</div>
[snip]
--
BootNic Wed Apr 4, 2012 02:31 am
Man who scratch ass should not bite fingernails.
*Ancient Chinese Proverbs*
Back to comp.lang.javascript | Previous | Next — Previous in thread | Find similar | Unroll thread
Clicking on Disabled Controls Gene Wirchenko <genew@ocis.net> - 2012-04-03 16:57 -0700
Re: Clicking on Disabled Controls Mike Duffy <Use_guestbook_page@website.in.sig> - 2012-04-04 00:59 +0000
Re: Clicking on Disabled Controls Gene Wirchenko <genew@ocis.net> - 2012-04-03 21:42 -0700
Re: Clicking on Disabled Controls BootNic <bootnic.bounce@gmail.com> - 2012-04-04 02:31 -0400
csiph-web