onselect and focus crashes IE...Or does for me.

B

Brian H aines

This code crashes some versions of IE, so, do be careful if
you try it.

Here's some fun code to try. (I close all but one IE
window, with JUST this code in it.) Copy the code into an
HTML file, and open it up in IE. I used win2k SP4, IE6
SP1, all the latest patches.
Click on the input field "Start here - works" and hit the
TAB key

Then click on input field "Start here for crash" and hit
tab. Does it work for you? I've crashed 3 IE browsers in
as many sites with this code.

Fun code.

<!--- Cut here --------------The code (The inputs should be
on the same line, no word wrap) --->
<FORM name="CRASH_IE_FORM">
<input type="Text" name="seldoctype_1" value="Start here -
works">
<input type="Text" name="txtRemarks_1" value="Tab to this
field" onfocus =
"document.CRASH_IE_FORM.seldoctype_1.focus();document.CRASH_IE_FORM.seldoctype_1.value
= 'set focus worked';">
<BR>

<input type="Text" name="seldoctype_2" value="Start here
for crash">
<input type="Text" name="txtRemarks_2" value="Tab to this
field" onselect =
"document.CRASH_IE_FORM.seldoctype_2.focus();document.CRASH_IE_FORM.seldoctype_1.value
= 'set focus worked(?)';">
<BR>
</form>
<!--- Cut here --------------The code --->

There is probably some good reason why you can't do a
focus() from a onselect. Can't think of a good reason for
crashing my browser though. *shrug*

Cheers - Brian
 
R

Robert Aldwinckle

Brian H aines said:
This code crashes some versions of IE,
....

Confirmed. IE6sp2 (XPsp2RTM)

2004-09-11 19:09 Application Error Faulting application iexplore.exe,
version 6.0.2900.2180, faulting module mshtmled.dll, version
6.0.2900.2180, fault address 0x0004b38f.



---
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top