ID "edit-submit" already defined

smitty - January 19, 2008 - 17:46
Project:jRating
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

When validating my page with http://validator.w3.org/check I'm getting the Error: 'ID "edit-submit" already defined'.

Apparently jRating and the seach-button are getting the same ID.

Who can help?

#1

smitty - February 13, 2008 - 17:54

In line 287 of the jrating.module I changed

$form['submit'] = array(

to

$form['jrating_submit'] = array(

Now the jrating-submit gets the id="edit-jrating-submit" instead of id="edit-submit" and thus the validation-error is gone.

Can anybody tell me, if this is the right way to do this or if there is a better way?

#2

hickory - February 13, 2008 - 17:59

You want

    'submit' => array(
      '#id' => "rating-submit-{$content_type}-{$content_id}",
      '#type' => 'submit',
      '#value' => t('Submit')
      )

I'll check this into CVS in a minute - meant to do it ages ago, sorry.

#3

smitty - February 14, 2008 - 10:01
Status:active» fixed

This works perfectly. Thank you very much!

#4

Anonymous (not verified) - February 28, 2008 - 10:12
Status:fixed» closed

Automatically closed -- issue fixed for two weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.