lundi 25 juin 2018

Javascript only radio buttons containing children with the same class should appear

I have been locked in this logic for 2 weeks, I need to do that only the "div" containing the "linha-opcao-resposta" class that has other children with the same class, as in the example below

<div style="padding-left:30px;clear:both;" class="linha-opcao-resposta">
                <div style="float:left;">
                    <label for="7329_2338" title="">27.3 Presença de agentes específicos na citologia oncótica?</label>
                    <input type="hidden" title="" id="7329_2338" name="hidden_2338">

                </div>
                <div style="padding-left:30px;clear:both;" class="linha-opcao-resposta">
                    <div style="float:left;">
                        <input type="radio" title="" id="7330_2370" name="radio_2370" indicador="CHECKUP_AGEESPCITONC" value="0">
                        <label for="7330_2370" title="">Não</label>

                    </div>
                </div>
                <div style="padding-left:30px;clear:both;" class="linha-opcao-resposta">
                    <div style="float:left;">
                        <input type="radio" title="" id="7331_2370" name="radio_2370" indicador="CHECKUP_AGEESPCITONC" value="1">
                        <label for="7331_2370" title="">Sim </label>

                    </div>
                    <div style="padding-left: 30px; clear: both; " class="linha-opcao-resposta">
                        <div style="float:left;">
                            <label for="7331_2371" title="">27.3.1 Agente 1</label>
                            <input type="text" title="" id="7331_2371" name="text_2371" indicador="CHECKUP_AGEESPCITONC_AGENTE_1" class="rfdRoundedCorners rfdDecorated rfdInputDisabled">

                        </div>
                    </div>
                    <div style="padding-left: 30px; clear: both; " class="linha-opcao-resposta">
                        <div style="float:left;">
                            <label for="7332_2371" title="">27.3.2 Agente 2</label>
                            <input type="text" title="" id="7332_2371" name="text_2371" indicador="CHECKUP_AGEESPCITONC_AGENTE_2" class="rfdRoundedCorners rfdDecorated rfdInputDisabled">

                        </div>
                    </div>
                    <div style="padding-left: 30px; clear: both; " class="linha-opcao-resposta">
                        <div style="float:left;">
                            <label for="7333_2371" title="">27.3.3 Agente 3</label>
                            <input type="text" title="" id="7333_2371" name="text_2371" indicador="CHECKUP_AGEESPCITONC_AGENTE_3" class="rfdRoundedCorners rfdDecorated rfdInputDisabled">

                        </div>
                    </div>
                </div>
                <div style="padding-left:30px;clear:both;" class="linha-opcao-resposta">
                    <div style="float:left;">
                        <input type="radio" title="" id="7334_2370" name="radio_2370" indicador="CHECKUP_AGEESPCITONC" value="2">
                        <label for="7334_2370" title="">Exame não realizado</label>

                    </div>
                </div>
                <div style="padding-left:30px;clear:both;" class="linha-opcao-resposta">
                    <div style="float:left;">
                        <input type="radio" title="" id="7405_2370" name="radio_2370" indicador="CHECKUP_AGEESPCITONC" value="3">
                        <label for="7405_2370" title="">Não se aplica</label>

                    </div>
                </div>
            </div>

only radio buttons containing children with the same class of "linha-opcao-resposta" should appear, other radio buttons that do not contain, should make those containing children disappear.




Aucun commentaire:

Enregistrer un commentaire