User tests: Successful: Unsuccessful:
The javascript code necessary for the radio buttons to work, has been duplicated and placed substantially unchanged among templates isis, protostar and beez3.
The original code suffered a bug which prevents the OnChange JavaScript event to be thrown.
Over time, the 'change' event trigger has been added to isis version here by @bembelimen and to protostar version here by @Minei3oat and they hopefully can review and confirm this PR.
This PR ports the same fix to the beez3 template.
Put some HTML+JavaScript code to show the onchange event into an article. The following code is fine for that purpose.
Tip: Note that you need to use Editor:none as back-end editor to actually add the code, otherwise javascript code could be stripped out during article save.
<div class="controls">
<fieldset id="jform_offline" class="btn-group btn-group-yesno btn-group-reversed radio">
<input type="radio" id="jform_offline0" name="jform[offline]" value="1"/>
<label for="jform_offline0">Yes </label>
<input type="radio" id="jform_offline1" name="jform[offline]" value="0" checked="checked"/>
<label for="jform_offline1">No </label>
</fieldset>
</div>
<script>
jQuery('input[type=radio][name="jform[offline]"]').change(function () {
alert('The value has changed. New value: ' + this.value);
});
</script>
When I change the value to the radio button in the back-end, an alert should notify that the event has been raised.
While it works as expected for protostar template, it doesn't on beez3 template.
On beez3 template when user clicks on the radio control (the cue ball) the change event is raised, but when the user clicks on the radio button label, the value changes without raising the onchange event.
Status | New | ⇒ | Pending |
Category | ⇒ | JavaScript Front End Templates (site) |
I have tested this item
This Fix works, but it is not the best solution. As I tried to explain in #12029, the whole JavaScript-Code is useless, because Beez3 doesn't contains the needed CSS-Code. Removing the whole JavaScript-Code would solve the issue, too.
Status | Pending | ⇒ | Ready to Commit |
Ready to Commit after two successful tests.
@Minei3oat I agree. But in my experience it's hard to convince the comunity to remove something, especially in a maintainence release. And they have a point. After all, who knows if any extension around the world relies on this (useless) feature?
So, a new major version would the best opportunity to remove this code. And infact the entire beez3 templates has been removed in Joomla 4, I guess.
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-03-17 15:14:38 |
Closed_By | ⇒ | mbabker | |
Labels |
Added:
?
|
I have tested this item✅ successfully on fcdb626
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19538.