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
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