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 |
Jump to:
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
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
This works perfectly. Thank you very much!
#4
Automatically closed -- issue fixed for two weeks with no activity.