Closed (fixed)
Project:
multiadd
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
13 Dec 2011 at 17:58 UTC
Updated:
29 Dec 2011 at 09:40 UTC
Jump to comment: Most recent file
I'm trying to create form with 3 different '#multiadd' elements on it. When doing so it seems that only the last element rendered actually works. The other two get an "Add" button but clicking it does nothing.
It appears that when there are multiple elements on the page and they all use the same text for the "Add" button it doesn't know which button was clicked. Should probably add a #name property to the add/remove buttons.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | 1369798-1-multiadd_name_property-eojthebrave.patch | 1.04 KB | eojthebrave |
Comments
Comment #1
eojthebraveThis should fix it. Adds a unique #name property the add/remove buttons.
Comment #2
sidharth_k commentedYes, this problem was encountered by me previously and the way I solved it (i.e. more than 1 multiadd required on same page) is that you need to create a unique
#add_text
#remove_text
property on the multiadd. As long as the text is different for all three buttons you won't encounter any problems. Does this patch give us any advantage to method above?
Comment #3
sidharth_k commentedCool... I played around with it. Its now possible to have buttons with the same text on multiadds on the same page. Previously if there were 2 or more multiadds we needed to give them different #add_text and #remove_text to prevent the clashing you described above.
Comment #4
sidharth_k commentedThis has been committed to the 6.x-1.x-dev branch
Thanks!
Comment #5
sidharth_k commented