|
Posted by Stan McCann on 02/17/06 20:10
"David Graham" <david.graham18@ntlworld.com> wrote in news:M6nJf.23559
$Dn4.1182@newsfe3-gui.ntli.net:
> Is the code below abusing the use of the paragraph markup?
> <form action="index.html">
> <p>
> <input type="checkbox" id="check">
> <script type="text/javascript">
> document.write( "<img src='unchecked.png'
> onclick='checkHandler();' alt='' id='fakeCheck'>" );
> </script>
> <input type="submit">
> </p>
> </form>
> thanks
> David
>
>
>
I don't like the term "abuse" in this context, but yes, I'd say it is
not proper as there are (some may debate this) other more suitable
elements. I have seen discussion here before about the use of tables
for a form. It is my opinion that labels and input fields make up
tabular data so why not use a table?
Another element that can be used is the <fieldset> element which some
don't like because then <legend> must also be used. Personnally, I
like the way this works and looks so I frequently use these styling the
<fieldset>. And you can still use a table within <fieldset> if
desired.
In your shortened example with only two items, I probably wouldn't
bother with a table. On longer forms, I sometimes do use a table. On
very short ones like:
<div class="mynmsu">
<a href="http://my.nmsu.edu">My<strong>.</strong>NMSU</a><br />
<form action="http://www.google.com/u/newmexicostate"
method="get">
<div>
<input type="hidden" name="domains" value="nmsu.edu" />
<input type="hidden" name="sitesearch" value="nmsu.edu" />
<label for="q">Search</label>
<input type="text" name="q" id="q" value="" size="12" />
<input type="submit" name="sa" value="Go" />
</div>
</form>
</div>
I don't see a need for tables or <fieldset> so just use <div>.
If you don't like the table or <fieldset> options or you don't want to
use either for some other reason, then using a <div> is more
appropriate. I don't believe that the information within <p> in your
(or my) example qualifies as a paragraph.
--
Stan McCann, "Uncle Pirate" http://stanmccann.us/
Webmaster, NMSU at Alamogordo http://alamo.nmsu.edu/
Now blocking Google Grouper posts and replies.
http://blinkynet.net/comp/uip5.html
Navigation:
[Reply to this message]
|