Download & Extend

ID "edit-submit" already defined

Project:jRating
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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?

Comments

#1

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

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

Status:active» fixed

This works perfectly. Thank you very much!

#4

Status:fixed» closed (fixed)

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

nobody click here