Connecting Tech Pros Worldwide Forums | Help | Site Map

IE6 bug? form.focus() breaks border style

Johannes Kiehl
Guest
 
Posts: n/a
#1: Feb 11 '06
Hi group,

I've been losing most of my remaining hair today, trying to
track down a problem with IE6.0 (builds: .2600 and XP SP 2).

I set the border-width of form input fields to 1px via
inline CSS.
But whenever I call the focus() method of any of the form
fields, the border width of the (first) submit button changes
to 2px. It doesn't matter whether the focus() method is called
immediately onload or whether it's delayed with settimeout().

I suppose I'm not the first earthling to notice this, so
any reference to the problem and solutions is welcome here
(might even restore my mop).

A working sample can be seen here:
http://www.absentia.de/temp/border2.htm

As web pages don't live forever, I'll attach the code to
the post. Don't grumble, it's short...

Thanks for your comments
Johannes

--- 8< ---

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Login</title>
<style>
form.login input {
border:1px solid #000;
}
</style>
<script type="text/javascript">
function setfoc() {
document.getElementById('SUser').focus()
// setTimeout("document.getElementById('SUser').focus ()",100);
}
</script>
</head>

<body onload="setfoc()">
<form method="POST" action="#" class="login" name="f" id="f">
<label for="SUser">Name</span>
<input type="text" length="24" name="SUser" id="SUser">
<label for="SPU">Pass</span>
<input type="text" length="24" name="SPU" id="SPU">
<input type="submit" value=" Login " name="submit" id="submit">
</form>
</body></html>

--- >8 ---

--
Please don't send personal email to the From: address. -->>
ed tod iduej ta oj :siht rof bmud oot era stobmaps epoH <<--


BootNic
Guest
 
Posts: n/a
#2: Feb 11 '06

re: IE6 bug? form.focus() breaks border style


> "Johannes Kiehl" <dont-use-this@arcor.de> wrote:[color=blue]
> news:pan.2006.02.11.15.49.10.254196@arcor.de....
>
> Hi group,
>
> I've been losing most of my remaining hair today, trying to
> track down a problem with IE6.0 (builds: .2600 and XP SP 2).
>
> I set the border-width of form input fields to 1px via
> inline CSS.
> But whenever I call the focus() method of any of the form
> fields, the border width of the (first) submit button changes
> to 2px. It doesn't matter whether the focus() method is called
> immediately onload or whether it's delayed with settimeout().
>
> I suppose I'm not the first earthling to notice this, so
> any reference to the problem and solutions is welcome here
> (might even restore my mop).
>
> A working sample can be seen here:
> http://www.absentia.de/temp/border2.htm
>
> As web pages don't live forever, I'll attach the code to
> the post. Don't grumble, it's short...
>
> Thanks for your comments
> Johannes
> [/color]
[snip]

IE adds a black border to the <input type="submit>/<button
type="submit"></button> button when the form gets focus.

Remove your style and script and click on your form you should see
it, or change your border color to red and it will show up just as
well.

If you replace your input submit with a button submit the border
change will not draw much attention.

--
BootNic Saturday, February 11, 2006 2:23 PM

All my humor is based upon destruction and despair. If the whole
world was tranquil, without disease and violence, I'd be standing on
the breadline right in back of J. Edgar Hoover.
*Lenny Bruce US comedian, satirist, author*


Johannes Kiehl
Guest
 
Posts: n/a
#3: Feb 12 '06

re: IE6 bug? form.focus() breaks border style


Oh my*. Thanks. I was blind.

On Sat, 11 Feb 2006 19:23:30 +0000, BootNic wrote:[color=blue]
> IE adds a black border to the <input type="submit>/<button
> type="submit"></button> button when the form gets focus.[/color]

Just out of insatiable curiosity: is there a way to suppress
this form focus marking behaviour?
[color=blue]
> Remove your style and script and click on your form you should see
> it, or change your border color to red and it will show up just as
> well.[/color]

Johannes
[*"oh my" is Bavarian for "oh my"]
--
Please don't send personal email to the From: address. -->>
ed tod iduej ta oj :siht rof bmud oot era stobmaps epoH <<--

Thomas 'PointedEars' Lahn
Guest
 
Posts: n/a
#4: Feb 12 '06

re: IE6 bug? form.focus() breaks border style


Johannes Kiehl wrote:
[color=blue]
> On Sat, 11 Feb 2006 19:23:30 +0000, BootNic wrote:[color=green]
>> IE adds a black border to the <input type="submit>/<button
>> type="submit"></button> button when the form gets focus.[/color]
>
> Just out of insatiable curiosity: is there a way to suppress
> this form focus marking behaviour?[/color]

No, and that is a Good Thing.


PointedEars
BootNic
Guest
 
Posts: n/a
#5: Feb 12 '06

re: IE6 bug? form.focus() breaks border style


> "Johannes Kiehl" <dont-use-this@arcor.de> wrote:[color=blue]
> news:pan.2006.02.12.00.22.40.434843@arcor.de....[/color]
[snip][color=blue]
> Just out of insatiable curiosity: is there a way to suppress
> this form focus marking behaviour?[/color]
[snip]

I do not know. Perhaps someone else may be able to help you with
that.

--
BootNic Saturday, February 11, 2006 8:20 PM

Thirty-five is when you finally get your head together and your body
starts falling apart.
*Caryn Leschen*

Closed Thread


Similar JavaScript / Ajax / DHTML bytes