[Sussex] Make IE 7 crash
Vicky Lamburn
vicky.lamburn at googlemail.com
Thu Jan 31 15:32:00 UTC 2008
Hullo,
Unfortunately Internet Explorer crashes are in my experience the least
of my worries when it comes to designing anything as generally
speaking it's the cocked up nature of its understanding of HTML that
causes the headaches week in week out.
Take today's discovery for example: I am now using the <button> tag
instead of <input type="submit" etc. This gives me the potential in a
compliant browser (anything Gecko, Webkit/KHTML and Opera based
generally) the opportunity to have a submit button a la:
<button type="submit">
Which I can then give a caption:
<button type="submit">My Button Caption</button>
(or even indeeed <button type="submit"><img src="mahusive_pic.jpeg"
alt="My Button Caption"/></button>)
And say I have two buttons that are both submits, one for accepting
changes and one for rejecting them which I could do with
<button type="submit" value="acceptChanges" id="submitButton">Accept
Changes</button> <button type="submit" value="rejectChanges"
id="submitButton">Reject Changes</button>
That way when I request the form value for 'submitButton' I would on a
complaint browser get either acceptChanges or rejectChanges which in
the server side script the form submits to I can use to evaluate what
to do.
Guess what. IE including the latest version 7 with its patches doesn't
do this. (Go on, say you're surprised) Instead it sends the innerHTML
of the button tags, meaning that IE will send "Accept Changes" instead
of acceptChanges and "Reject Changes" instead of "rejectChanges"
Ridiculously infuriating.
Solution is to use Javascript which is less than optimal with the following:
<button type="submit" id="acceptChanges" value="1"
onclick="this.setAttribute('value',this.value);"
>Accept Changes</button>
<button type="submit" id="rejectChanges" value="0"
onclick="this.setAttribute('value',this.value);"
>Reject Changes</button>
Oh the fun I have every week waging battle with the delights of IE and
80% of the population that use it.
Vicky
More information about the Sussex
mailing list