There's a problem when showon
attribute is applied to field inside a group, but target field is not within it.
<fieldset>
<field
name="has_full_image"
type="radio"
>
<option value="yes">JYES</option>
<option value="no">JNO</option>
</field>
</fieldset>
<fields name="images">
<field
name="image_fulltext"
showon="has_full_image:yes"
/>
</fields>
because the attached rel attribute is generating id from the source field:
<div class="control-group showon_yes" rel="showon_jform[images][has_full_image]">
...
</div>
Dirty workaround is to place both field withing same group
Labels |
Added:
?
|
Labels |
Added:
?
|
Category | ⇒ | Libraries |
Hi,
In fact, it is why I was talking about in that thread: #3379 (comment)
And it could be made by a simple modification: 1b30841
Regards,
I have also found showon fails to work in repeatable fields even when all of the references are in the same repeatable grouping. I've included the showon/repeatable failure as a note in issue #6882
@Fedik your "working theory" seems like a better overall implementation than the current "let's add an 'id' to the field rel for showon" implementation (although I think you have some typo's in your example, i.e. field rather than fields, etc). I've been learning more about object oriented programming concepts recently, I wonder what would be the best way to set up things like showon to function with object references to fields rather than as a procedural item increment reference to the fields? To me (with my very limited experience with javascript and javascript objects and connecting those JS objects to PHP and PHP objects) your method makes more sense to me and seems to be closer to an object implementation.
I also wonder if this could be propperly implemented so entire fieldsets could have showon references.
it seems that its not working with modules on front end as well. however same module fields are working fine with showon attribute.
Category | Libraries | ⇒ | Fields Libraries |
Hi you created this issue sometime ago but have not provided any code for people to evaluate. As no one else has shown any interest in providing the code and you have not then I am closing this issue at this time. If code is provided (a pull request) it can always be re-examined.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-05-08 13:23:35 |
Closed_By | ⇒ | brianteeman |
some time ago I had idea change to:
so in script we can take all fields with name
[has_full_image]
and filter out only the fields that under groupshowon_jform[options]
... in theory such thing can work on repeatable field also ....but just a theory