Hello, I believe the "Recent Poll" block is not valid XHTML 1.0 strict...

These are the errors I get when the block is enabled. Without the block enabled, it validates 1.0 strict.

   1.  Error  Line 263 column 56: ID "poll_view_voting" already defined.

          <form action="/drupal48/node/21"  method="post" id="poll_view_voting">

      An "id" is a unique identifier. Each time this attribute is used in a document it must have a different value. If you are using this attribute as a hook for style sheets it may be more appropriate to use classes (which group elements) than id (which are used to identify exactly one element).

      ✉
   2. Info Line 157 column 58: ID "poll_view_voting" first defined here.

            <form action="/drupal48/node/21"  method="post" id="poll_view_voting">

   3. Error Line 270 column 52: ID "edit-nid" already defined.

      </div>    </div><input type="hidden" name="nid" id="edit-nid" value="21"  />

      ✉
   4. Info Line 168 column 46: ID "edit-nid" first defined here.

          </div><input type="hidden" name="nid" id="edit-nid" value="21"  />

   5. Error Line 272 column 48: ID "edit-poll-view-voting" already defined.

      ...put type="hidden" name="form_id" id="edit-poll-view-voting" value="poll_view_

      ✉
   6. Info Line 170 column 48: ID "edit-poll-view-voting" first defined here.

      ...put type="hidden" name="form_id" id="edit-poll-view-voting" value="poll_view_

Comments

ChrisKennedy’s picture

Title: Poll.module block output not valid XHTML 1.0 strict » Forms: Duplicate ids leads to invalid XHTML 1.0 strict
Version: x.y.z » 5.x-dev
Component: poll.module » forms system

This is a general problem with the forms api due to the way it generates ids for each element. I'm not sure if anyone is working on a fix.

anders.fajerson’s picture

Subscribing (sorry).

theenglishguy’s picture

You can validate this by using a bit of javascript. I outlined this in a post XHTML 1.1 & Multiple IDs. Should fix it :)

alexmarkley’s picture

The whole "auto-generated form ids aren't unique enough" problem is pretty serious for me, so I'm subscribing to this issue. (The only intelligent thing I have to say about this family of issues.)

chx’s picture

Status: Active » Closed (duplicate)