W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > October to December 2003

Re: width of dropdowns

From: <w3wai@puoli.net>
Date: Thu, 20 Nov 2003 08:21:53 +0200 (EET)
Message-ID: <55520.194.111.39.65.1069309313.squirrel@webmail.neutech.fi>
To: w3c-wai-ig@w3.org

> on some pages the site will return data to the user in the form of
> dropdowns.  the width of the dropdowns is dependent on the number of
> characters in the lines(the lines are addresses and one of them may
> only be 20 characters long, but another one may be 400 characters
> long and that would dictate the overal width).

Hi.

First, I agree with comments by Jaz-Michael King.  I wonder where the
requirement to use dropdowns is coming from but you probably have your
reasons.

Are the addresses mentioned in your mail postal addresses (as I would
assume) or perhaps URI addresses?  (If they were URIs, you probably would
not even think of truncating them.  Long URIs are problematic in a way
that they don't contain spaces and thus don't wrap nicely even if
presented in an other way than dropdown lists.)

How about adding a textarea to your form, presenting truncated addresses
in the dropdown lists and using some scripting to show the full address of
the selected option in the textarea? [1]

To ensure that the application is accessible also without JavaScript, you
could initially add full addresses to option texts and truncate them using
JavaScript.  (Maybe even use JavaScript to add the textarea to the form.)

Contact me if you find this suggestion interesting and require assistance
in making it work.

    Samuel

[1] Code example (untested):
<select name="address"
onchange="this.form.real_addr.value=this[this.selectedIndex].value">
 <option value="really long full address 1">truncated addr1...</option>
 <option value="really long full address 2">truncated addr2...</option>
 <option value="really long full address 3">truncated addr3...</option>
</select><br>
<textarea name="real_addr">[possible explanation text as initial value]
</textarea>
Received on Thursday, 20 November 2003 01:21:56 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 19 July 2011 18:14:13 GMT