Is it a valid structure?

S

Samuël van Laere

I'm just wondering if this is a valid structure:

<fieldset>
<legend>Please make a choice:</legend>
<ul>
<li><a href="add.php">Add data</a></li>
<li><a href="display.php">Display data</a></li>
<li><a href="edit.php">Edit data</a></li>
</ul>
</fieldset>

Anyone?


Regards,
Samuël van Laere
 
K

kayodeok

Samuël van Laere said:
I'm just wondering if this is a valid structure:

<fieldset>
<legend>Please make a choice:</legend>
<ul>
<li><a href="add.php">Add data</a></li>
<li><a href="display.php">Display data</a></li>
<li><a href="edit.php">Edit data</a></li>
</ul>
</fieldset>

Strange! But after enclosing with the Form element,
http://www.htmlhelp.com/tools/validator/direct.html
says it is valid.

I don't know what you are trying to achieve so this is my
best guess:

<form action="..." method="post">
<div>
<fieldset>
<legend>Please make a choice:</legend>
<input type="radio" name="data" value="add.php">Add data<br>
<input type="radio" name="data" value="display.php">Display data<br>
<input type="radio" name="data" value="edit.php">Edit data<br>
<input type="submit" value="Send">
</fieldset>
</div>
</form>
 
J

Jukka K. Korpela

kayodeok said:
Strange! But after enclosing with the Form element,
http://www.htmlhelp.com/tools/validator/direct.html
says it is valid.

It's not that strange, and it's equally valid without any form element.
Just bear in mind that "valid" only means compliance to some formal
rules, see http://www.cs.tut.fi/~jkorpela/html/validation.html
I don't know what you are trying to achieve so this is my
best guess:

<form action="..." method="post">

There's no need to guess, and no need to use a form.

The markup, as given in the original question, has a simple list of
links. That's the best navigational tool ever invented; forms are poor
and confusing surrogates.

But the fieldset markup around it, although valid (remember that this
only means compliance to some formal rules, which _must_ allow a lot of
nonsense in any real application), is rather illogical. There are no
form fields around, and no fields are called for.

If, on the other hand, you really really want the visual appearance of
a fieldset and its legend, as implemented in some particular
browser(s), then such markup is what you need. The appearance cannot be
described in current CSS. Well, you can come pretty close I suppose, by
drawing a border around the <ul> element and by using a negative margin
to position the header-like text to that it appears on top of a segment
of the border. But then it would probably be _too_ close a fieldset
appearance to confuse the user but not close enough to please the
designer!
 
K

kayodeok

There's no need to guess, and no need to use a form.

The markup, as given in the original question, has a simple list
of links. That's the best navigational tool ever invented; forms
are poor and confusing surrogates.

But the fieldset markup around it, although valid (remember that
this only means compliance to some formal rules, which _must_
allow a lot of nonsense in any real application), is rather
illogical. There are no form fields around, and no fields are
called for.

Thanks for clarifying, I assumed he was designing a form because of
the presence of the the fieldset and legend element.

I didn't try out his code in my browser so it wasn't immediately
obvious to me that the fieldset element happens to look like a border
with rounded corners and that is probably the effect he was trying to
achieve...
 
J

Jukka K. Korpela

kayodeok said:
I didn't try out his code in my browser so it wasn't immediately
obvious to me that the fieldset element happens to look like a
border with rounded corners and that is probably the effect he was
trying to achieve...

The appearance of a fieldset element depends on many things, including
platform. On Win98 for example, IE 6 displays it with a rectangular
border.
 
K

kayodeok

The appearance of a fieldset element depends on many things,
including platform. On Win98 for example, IE 6 displays it with
a rectangular border.

I didn't know that, thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,161
Latest member
GertrudeMa
Top