C
C
clavik13122019-03-23 21:21:11
DLE
clavik1312, 2019-03-23 21:21:11

DLE - how to change the dropdown list from the additional field [yes, no]?

Good day to all, there is such a question on CMS DLE 13.2 (the latest at the moment)
I have an additional field for the news field type: Drop-down list yes, no,
in general, in my template in addnews.tpl I want to change the appearance of the output of this list
specifically, I want to make regular checkboxes instead of a drop-down list,
I know how to select a specific category through the checkbox in addnews.tpl
in this case, if the checkbox is in the checked position, then category 5 will be attached to the news:

<input type="checkbox" name="catlist[]" value="5"> Premium

but I need a little something else, I want to change the drop-down list to checkboxes
, before writing here I searched everything and this is what I managed to find:
<script>
$(function(){
    $(".xfgender option").each(function(i){
        if($(this).prop('value')==$("#gender_val").text()) $(this).prop('selected',true);
    })
})
</script>

<div id="gender_val">[xfinput_gender]</div>
<select name="xfield[gender]" class="xfgender" id="xfield[gender]">
<option value="0">Мужской</option>
<option value="1">Женский</option>
</select>

i created an additional field gender the type of the field the drop-down list was specified
but still nothing worked out for me yes the drop-down list is shown but no matter what I choose the first or second item nothing works
please help

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question