Christian Heilmann

You are currently browsing the archives for the Odds & Ends category.

Archive for the ‘Odds & Ends’ Category

Free Scott Adams ebook

Friday, January 6th, 2006

Andrews and McMeel are giving out a free PDF copy of Scott Adams’ book ‘God’s Debris’. Allegedly the real book was hard to market, but worked out well enough.

Scott Adams is most known for his Dilbert comics, but wrote some enjoyable full books, too. This one is not in the dilbert fashion, but a lot more philosophical, as hinted in the end of “Dilbert of the future”.

Styling submit buttons or using links to submit a form?

Tuesday, January 3rd, 2006

Common issues Sending Form data to the server can be achieved in several ways, all of them with their pros and cons. It is especially tricky to create a form that has to be accessible, look great and allow for internationalisation (i18n). This post discusses the different options and offers a JavaScript that works around most issues.

The most accessible and least pretty way to submit a form is via a submit button.

Pros:

  • they resize with the font settings
  • their text content is determined by the value attribute, therefore it is is easy to localise them

Contras:

  • You cannot style them consistently across browsers, and they cannot get rollover states 1

The other option is to use an input element with the type “image”, which enables you to use any image to submit the form

Pros:

  • You have total control over the look and feel

Contras:

  • Whilst applying a proper alternative text makes the images accessible to blind visitors, images don’t scale when the font size gets changed, which means they are not 100% accessible.
  • i18n can become a maintenance issue, as you need to create (or automatically generate via the backend) images for each language.

Together with JavaScript, text links can be used to submit a form.

Pros:

  • You have total control over the look and feel
  • Text links scale with the font settings
  • i18n is dead easy, as it is text content of the page, not even alternative text in attributes

Contras:

  • requires JavaScript to work

Putting them all together

If you use a small JavaScript to check the document for submit buttons and dynamically replacing them with text links, you’ll get the best of both worlds:

  • users without JavaScript will get normal submit buttons
  • users with JavaScript styled text links.

See the demonstration page and try it alternately with JavaScript on and off.

The script that replaces the submit buttons uses Unobtrusive JavaScript and allows you to define a special class to add to each of the replacement links. The links will also have the same ID as the original submit button and their value as text content.

Feel free to use it and report any issues/problems here.2

1 It is debateable if you should design your own form controls anyways, after all the users knows how forms looks in their environment and some browsers/operating systems offer rollover states for submit buttons.

2 One issue is that if you don’t have any submit or image button in the form you won’t be able to send the form by hitting the enter button on the keyboard. To counterwork this you might want to add another image button or alter the script to hide the submit buttons instead of replacing them.

Things Web Developers can learn from craftsmen part 1

Saturday, December 31st, 2005

I spent Christmas at my parents’ and went through some of the old paperwork to see what can be ditched. One of the contracts I found dated 1996 and was my application to start a web design business.

I remember clearly that back then the government agency dealing with new businesses asking me if “web design” is a craft, and if what I am doing is weaving nets in a beautiful manner. While that left me speechless back then I realize now that there is a lot craftsmen and old trades can teach us as web developers.

I jobbed a lot as a bricklayer, painter and plumber amongst other things and learnt one thing pretty soon:
Although you think you are dead clever and the people you have to work with might not be your cup of tea when it comes to enlightenment about equality or politics – in their area of expertise you can learn a lot from them and you know less than they do. A lot of times higher school education leaves us with a lot of knowledge, but not much practical thinking. Simply by listening you can prevent making an idiot out of yourself or work hard without getting the job done. (more…)

Samorost – A wonderfully designed time waster

Saturday, December 24th, 2005

If you like puzzle games and want to see really cool rust/dirt/moss inspired designs with off-beat humour and a dash of drug induced ambient music check out Samorost and Samorost2. I spent the money on the full version and must say it really was worth it. I want more of their stuff!

Tips & Tricks

It seems that a lot of people end up here looking for tips on solving Samorost2. Well, I don’t want to spoil your fun, but here are some (I solved the whole game):

  • It seems that boiled poppy in water makes you sleep immediately and give up what you are holding. However, you cannot boil water someone else is drinking. You need to put a cork into it.
  • Lizards like eating bugs, although they might not agree with them. Flies, however, are happy to deal with the remains.
  • If there are colours on wheels, lining all of them up vertically (and really straight) gets you further
  • You cannot go through dark tunnels without a torch, although you might need to enter one to find one.
  • Flowers react with insects
  • There is nothing better to wake up a cabbie than a strong boiled coffee. Light bulbs get very hot.
  • Your dog is an odd creature, flowers don’t wilt when it pees on them, they grow.

Why is the end of the year always utter sh*t?

Tuesday, December 20th, 2005

I am on my first day of end of the year holiday now, and just went through all the mail, as I will be gone till the 3rd of January to visit my family and party with some friends over New Year’s in Munich. I was happy to have a fat, round 4 figure on my bank account which means I can spend something on my family – like taking the dog to the vet as father is too tight to pay “that much for a pooch” and mother is very concerned. Well, I was wrong. It seems the UK system cannot stand a person that lives on his own wage and never had an overdraft. (more…)