The comment module's name input field has no unique ID, so drupal sites don't validate:

   1.  Error  Line 110 column 51: ID "edit-name" already defined.

      ...text" maxlength="60" name="name" id="edit-name"  size="30" value="Gast" class

      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 64 column 51: ID "edit-name" first defined here.

      ...text" maxlength="60" name="name" id="edit-name"  size="15" value="" class="fo
CommentFileSizeAuthor
#1 comment.module_68.patch1.18 KBntiostle

Comments

ntiostle’s picture

StatusFileSize
new1.18 KB

I created a patch to solve the problem

gbright’s picture

Hi Andreas

I am having the same problem with the following link http://rainbowplanet.com.au/contact when checking this document for XML well-formedness and validity I get the following error.

Line 127 column 57: ID "edit-name" already defined.

maxlength="60" name="edit[name]" id="edit-name" size="15" value="" class="fo

How do I apply your patch to resolve this issue?

regards

Gavan

Drupal 4.7
RedHat Enterprise Linux 2.6.9-42.0.8.ELsmp
Apache web server
MySQL Database 5.0.24-standard
PHP 5.2.0

jonathan_hunt’s picture

I ran into the same issue on the contact form page.

Index: modules/contact/contact.module
===================================================================
--- modules/contact/contact.module      (revision 4044)
+++ modules/contact/contact.module      (working copy)
@@ -434,6 +434,7 @@
       '#maxlength' => 255,
       '#default_value' => $user->uid ? $user->name : '',
       '#required' => TRUE,
+      '#id' => 'contact-name',
     );
     $form['mail'] = array('#type' => 'textfield',
       '#title' => t('Your e-mail address'),
@@ -479,6 +480,7 @@
     }
     $form['submit'] = array('#type' => 'submit',
       '#value' => t('Send e-mail'),
+      '#id' => 'contact-submit',
     );
   }
   else {

tumblingmug’s picture

Title: XHTML Validation: ID "edit-name" already defined. » XHTML Validation Helper Module

Who takes care about absolute valid XHTML in Drupal 5.x may find this module helpful. It changes the submit button ID's on web pages by expanding the button ID name depending on the module's name. See download below.
In Drupal 6 this buglet is solved.

Tarball Download here:
http://www.screencast.at/modul-valid-erzeugt-gueltiges-XHTML-bei-mehrere...

mr.baileys’s picture

Title: XHTML Validation Helper Module » XHTML Validation: ID "edit-name" already defined.
Component: comment.module » forms system
Status: Active » Closed (duplicate)
Issue tags: +XHTML validation

Sounds like a duplicate of #111719: FAPI fails to check auto-generated IDs for uniqueness - XHTML validation fails..

@tumblingmug: the title should describe the issue itself, not a remedy or work-around. Resetting the title to the original.