How to differentiate the names of each group of radio buttons?

0

I'm using the formvalidation.io plugin to do the validation. By default, it does the validation by the name of the radio buttons. But I can not do it that way. I need to know some way / logic to differentiate each name from each group of radio buttons.

Can anyone help me?

EXAMPLE:

<div>
    <div id="perguntas">
        <label>1 - Pergunta 1</label>
        <input type="hidden" name="pergunta[]" value="$pergunta->id" />
        <div id="respostas">
            <input type="radio" name="resposta[$pergunta->id]" value="1" /> Male
            <input type="radio" name="resposta[$pergunta->id]" value="2" /> Female
            <input type="radio" name="resposta[$pergunta->id]" value="3" /> Other
        </div>
        <div>
            <textarea name="mensagem[$pergunta->id]" rows="3" />
        </div>
    </div>
    <div id="perguntas">
        <label>2 - Pergunta 2</label>
        <input type="hidden" name="pergunta[]" value="$pergunta->id" />
        <div id="respostas">
            <input type="radio" name="resposta[$pergunta->id]" value="1" /> Male
            <input type="radio" name="resposta[$pergunta->id]" value="2" /> Female
            <input type="radio" name="resposta[$pergunta->id]" value="3" /> Other
        </div>
        <div>
            <textarea name="mensagem[$pergunta->id]" rows="3" />
        </div>
    </div>

    <div id="perguntas">
        <label>3 - Pergunta ...</label>
        <input type="hidden" name="pergunta[]" value="$pergunta->id" />
        <div id="respostas">
            <input type="radio" name="resposta[$pergunta->id]" value="1" /> Male
            <input type="radio" name="resposta[$pergunta->id]" value="2" /> Female
            <input type="radio" name="resposta[$pergunta->id]" value="3" /> Other
        </div>
        <div>
            <textarea name="mensagem[$pergunta->id]" rows="3" />
        </div>
    </div>

    <div id="perguntas">
        <label>16 - Pergunta 16</label>
        <input type="hidden" name="pergunta[]" value="$pergunta->id" />
        <div id="respostas">
            <input type="radio" name="resposta[$pergunta->id]" value="1" /> Male
            <input type="radio" name="resposta[$pergunta->id]" value="2" /> Female
            <input type="radio" name="resposta[$pergunta->id]" value="3" /> Other
        </div>
        <div>
            <textarea name="mensagem[$pergunta->id]" rows="3" />
        </div>
    </div>  
</div>
    
asked by anonymous 03.03.2016 / 05:32

0 answers