Hi everyone,
At present, I’m using javascript to hide or show an attribute at page load based on attribute radio button value. For example:
$(document).ready(function() {
displaySource();
});
$('input[name="Article[source]"]').change(function(){
displaySource();
});
/*
* Show or hide corresponding source element base on radio button
*/
function displaySource() {
if ($('input[name="Article[source]"]:checked').val() == '1') {
$('.field-article-fileurl').show();
$('.field-article-file').hide();
} else {
$('.field-article-fileurl').hide();
$('.field-article-file').show();
}
}
I have researched but I couldn’t find any way to do it with Yii2. Does Yii2 support to handle it? (Ex: In Model or ActiveForm, ActiveField)