'

[Irl-dean] Content display control - button or hyperlink?

MacIonmhain, Eoin emacionm at revenue.ie
Fri Jul 11 11:59:54 IST 2008


Hi folks,

Yet another technical question from me - so feel free to tune out straight
away :)

I have a form with a load of fieldsets in it. It's pretty long, and a lot of
the fieldsets contain optional fields. To make the form appear less
intimidating and more usable, what I wanted to do is to initally display only
the legends of each section/fieldset of the form on screen, and then provide
some kind of control that allows users to expand/collapse the content of the
fieldset.

I've got a working version of this design implemented - Basically what I've
done is enclose the "hideable" part of the fieldset in a div. In my
stylesheet, this div is fully sized and set to display:block. Then when the
page is loaded, this div is set to display:none, and overflow:hidden, making
it invsible. At the moment, I'm using a button to control the showing/hiding
of the div (resetting the div to be visible, and doing some nice javascript
accordion style animation)

so my fieldset looks something like

<fieldset id="myFieldset">
<legend>My Legend</legend>
<input type="button" id="myFieldsetToggleButton"
onclick="showOrHideMyHideableFields()">

<div id="myFieldsetHideableFields">
<label for="field1">Label for Field 1</label>
<input type="text" id="field1">

<label for="field2">Label for Field 2</label>
<input type="text" id="field2">
<!-- More input fields here-->



</div>
</fieldset>

This works, and with javascript off, it shows everything on the form - so far
so good.

My question is this - is it better to use a Form control such as a button to
do the showing/hiding, as I've done above, or would a hyperlink be better?

I'd imagine a button is better, since JAWS in forms mode probably wouldn't
notice a hyperlink - however, lots of sites seem to use hyperlinks to provide
similar functionality - for example iGoogle.

Anyway, apologies for asking a technical question on a Friday, any feedback
is greatly appreciated!

Cheers

Eoin


************************

This message has been delivered to the Internet by the Revenue Internet e-mail service (OP)

*************************



More information about the CEUD-ICT mailing list