Create 2 fields with similar names.
I have two fields in my template...
<field name="hoverbackgroundColor"
class="small-input"
label="TPL_SERENITY_FONTS_HOVER_BACKGROUND_COLOR_LABEL"
description="TPL_SERENITY_FONTS_HOVER_BACKGROUND_COLOR_DESC"
type="color"
default=''
/>
<field name="hoverColor"
class="small-input"
label="TPL_SERENITY_FONTS_HOVER_COLOR_LABEL"
description="TPL_SERENITY_FONTS_HOVER_COLOR_DESC"
type="color"
default=''
/>
so, now you have got 2 fields
if you put color in the 2nd and save it returns empty
if you put color in the 1st it saves
if you put color in the 1st and 2nd it changes 2nd to match first!!!
craziest thing I've ever seen.
colors are independant
see above
both 3.6.5 and 3.7
This worked fine before and does work if the fields are NOT named similarly. Both are in "repeatable" form fields but I don't see that that is relevant since both repeatable and sub use the same color form field system.
Labels |
Added:
?
|
I have updated thew original comment so that the markup is displayed
I have updated the original comment so that the markup is displayed
Ah, didn't see that. The name shouldn't matter then. I do a similar thing in my template all the way.
This worked fine before and does work if the fields are NOT named similarly. Both are in "repeatable" form fields but I don't see that that is relevant since both repeatable and sub use the same color form field system.
That's most likely related to the repeatable then. I don't know from the top of my head how repeatables are stored. Maybe @Fedik would know more here.
Create 2 fields with similar names.
the names are not similar
I cannot reproduce it, in the template form all works fine:
however I am not tested in subform since last changes in the color field markup (I try to check later), there was a fix #12994 but no one tested, and now it out of date already
Category | ⇒ | com_fields |
Status | New | ⇒ | Discussion |
I haven't tried it with subforms yet. Thats something planned for today or tomorrow. It's interesting that it only happens if the name is related(?) or perhaps its because they are side-by-side. Very strange behavior
I just checked the subform with the color field in the Isis template and all works there for me
Closing as we have a PR
Status | Discussion | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2017-05-11 18:46:26 |
Closed_By | ⇒ | Bakual |
I'll check it in the late morning
I understand you correct that the two fields are named identical? Then that seems to be the expected behaviour to me. The names need to be unique in a form, otherwise one will overwrite the other.