S
S
SlimSavernake2016-03-23 15:00:56
JavaScript
SlimSavernake, 2016-03-23 15:00:56

How to show/hide divs depending on checkbox value via jquery?

I use ToggleButtonGroup - radio in the form of a group of buttons:

<div class="form-group field-realty-deal_type">
    <div class="col-sm-6"><input type="hidden" name="Realty[deal_type]">
        <div data-toggle="buttons" class="btn-group" id="realty-deal_type">
            <label class="btn-default btn"><input type="radio" value="0" name="Realty[deal_type]"> Продать</label>
            <label class="btn-default btn"><input type="radio" value="1" name="Realty[deal_type]"> Сдать</label>
            <label class="btn-default btn"><input type="radio" value="2" name="Realty[deal_type]"> Сдать посуточно</label>
        </div>
    </div>
</div>


Can you please tell me how to hide the other field if the button is pressed and show if the button is not pressed

Another field:
<div class="form-group field-realty-foobar"></div>

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