Archive for January, 2008

Buttons Back in Business

Monday, January 14th, 2008

Some time ago, Kevin Hale of Particletree described his rediscovery of the button element. I also made the same rediscovery once, and I had a brief moment of excitement when I realized how useful the button element can be for quickly putting together a nice web-based user interface.

Then came Internet Explorer and my dreams were crushed. The way buttons work in IE (including IE7) is a) standard-incompliant, b) insane, and c) useless. Here’s why:

What the standard says What IE is doing
If the button type is not specified, it defaults to submit. The default type is button.
When a button is used to submit a form, the contents of its value attribute is sent to the server. The inner text of the button is sent to the server.
If there is more than one submit button, only the value of the activated one is sent to the server. The inner text of all buttons is sent to the server.[1]
[1]

This was kind of fixed in IE7 — the other submit buttons are no longer sent to the server. However, it’s still the inner text that is transmitted, not the value.

From a practical point of view, this means that the value attribute is of no use, because it’s not being sent to the server when the form is submitted — instead, you’ll get whatever was placed between the <button> and </button> tags, including any HTML markup (this is just sick!). And, if you have multiple submit buttons in a form, you won’t be able to tell which one was clicked by the user, as they will be all sent to the server. Seriously, IE developers, what were you thinking?

Back then, I was left with two choices: either to forget buttons and keep using plain old inputs, or to fight the evil. And fight I did. Long story short, I wrote a piece of JavaScript (you know, the popular real-time browser bug-fixing technology) code which works around the irrational behavior of buttons in IE.

I’ve recently released the script as a jQuery plugin named ieFixButtons. Grab it if you want to use buttons the way they were supposed to.

I Live… Again!

Thursday, January 10th, 2008

As some of you, my dear visitors, might have noticed, I used to have a blog on this website. You might have also noticed that my blog has been dead for over a year. When something is dead for so long, it’s probably better for it to stay that way, but what the hell, I’ll try to resurrect it anyway.

The blog is alive again, but I’ve decided to throw away all the old content, since it was, well, old, and boring. Rest in peace, old content, you won’t be forgotten (until you get deleted from Google cache).

*sigh*

Well, nothing left to do but populate the blog with new, shiny, and interesting stuff. And make the blogosphere a little better place.

  • Archives

  • Categories

  • Meta

  • Latest Tweets


    Warning: Illegal string offset 'last_access' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 334

    Warning: Illegal string offset 'time_limit' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 334

    Warning: Illegal string offset 'last_access' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 336

    Warning: Illegal string offset 'twitter_api' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 234

    Warning: Illegal string offset 'user_token' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 262

    Warning: Illegal string offset 'user_secret' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 263

    Warning: Illegal string offset 'consumer_key' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 264

    Warning: Illegal string offset 'consumer_secret' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 265

    Warning: Illegal string offset 'twitter_username' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 270

    Warning: Illegal string offset 'show_retweets' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 272

    Warning: Illegal string offset 'exclude_replies' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 275

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 282

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 350

    Warning: Illegal string offset 'twitter_data' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 351
    Twitter outputted an error:
    .
    Warning: Illegal string offset 'time_format' in /usr/local/www/odyniec.net/public/blog/wp-content/plugins/twitget/twitget.php on line 484
  • Follow odyniec on Twitter

<