Formatting input fields in xHTML-MP

Something VERY important when you want to build a wireless site is to make users’ life easier when they need to input data. The first step is of use the smallest number of input fields that you can (selects or lists of links are always more comfortable), but when you can’t avoid it you should at least help the user. One way is of defining the format of the input field (numbers, letters, etc).

In the WML days you would add an attribute named “format” to the input field and specify the format you wanted to apply, for example “*N” for numbers only, “4N” if you require 4 numbers, “*X” for any uppercase character and so on. Check this out if you can’t remember.

With xHTML we don’t have the “format” attribute anymore so many browser developers agreed to use a specific style attribute: -wap-input-format
The syntax remains the same. Copying and pasting from an old page I was sure that worked, I used:
<input style=”-wap-input-format=*N”>

It worked for some devices and did not work for others. Posting on the great wmlprogramming list I got the solution: *N should be surrounded with apostrophes. The new syntax works like a charm:
<input style=”-wap-input-format=’*N'”>

&apos; may be used in place of ‘. With the devices I tested it worked nicely.

In case the style attribute did not work, you may try to use the old “format” attribute which is not compliant to the xHTML standard but some device support it nicely (for example the Samsung Z107). One extra of the format attribute is that you may also specify more complex strings such as “NNN-NNN-NNNN” if you want the user to input numbers the way they are generally referred in USA, for example.
Sample code:
<input format=”NNN-NNN-NNNN”>

I would also like to suggest this nice site that was suggested on the list. It has many useful information about WML and xHTML-MP and CSS.

UPDATE: Please, read the comments a kind visitor posted a little correction to my xHTML-MP styles.

What’s the best way to spend a spring week-end?

The answer is pretty simple, but probably not SO obvious:

Mounting your new IKEA Stolmen!
The apartment is starting to get filled with new furniture, but it takes time. :(
2 days of 2 people were not enough to finish, but at least we installed all the poles and part of the shelves. We still have a couple of drawers to mount and then we’ll be able to fill it with clothes.

I took some pictures, but it’s hard to render the idea of the spaces, I will try to attach them and see if it makes any sense.

Article in the Openwave newsletter

I am proud to announce that Openwave has released a new newsletter which also includes an article I wrote.

The article is about WURFL capabilities. Since we have so many I started talking about markups and how to discover the best markup to use in a “multi-markup” site.

You can read it here.

Feel free to comment.

Hopefully more articles about WURFL capabilities will come. I hope that this will clear up most of the doubts you might have about how to use the tools that WURFL provides (and use them at best!).

OS X on Intel? Yes

This is just a quick post…

I just moved to Mac’s (proud owner of a Powerbook 15″ for two years now) and we’re back to Intel! :(

What about “thinking different”?

is xHTML-MP different from WAP?

The first answer is obvious: Yes. They are different markups, so of course they are different.
What about the approach of the manufacturers and browser developers? Are they doing anything differently from how they managed WML? Well, manufacturers might not be happy about this, but unfortunately my answer is “no, it’s not SO different”.
It’s a little disappointing to see that every single browser does whatever he likes and differently from ther other (AGAIN). And this story is not NEW! We have seen it with web browsers, we have seen it with WML browsers and now we see it again with xHTML browsers. Didn’t anybody notice that since there was a domination of web browsers all sites looked good? I’m not saying that i’d be happy to see a single browser dominance (while it would make my life easier), but at least they could try to make pages look the same. Why agree on a thousand tags and then support 300 hundreds? Agree on 310 and make 300 work well and leave out the 10 least important!

I promise next week I’ll post some markup examples and the different layouts. They are not TOTALLY different, but they all present little differences, one doesn’t support the background color, the other uses different colors for links, the other doesn’t like fieldsets… OH!