0
I need to ask a simple questionnaire of questions and answers of multiple choice, in this case I chose the radio button...
In my PHP I’m receiving the posts and I’m already checking the answers with if
. My problem is, in the layout there’s no such thing as that little ball of radio button... it just picks up through the for
but I don’t know what’s going on that’s not working.
So far he’s this way:
And it’s supposed to be this way:
And my code is this:
-HTML
<div class="block_question1">
<ul>
<li id="pg1_q1">
<input name="acerto1" value="acerto1" type="radio" class="selecionar">
<label for="acerto1">Red</label>
</li>
<li id="pg1_q2">
<input name="acerto12" type="radio">
<label for="">yellow</label>
</li>
</ul>
<ul>
<li id="pg1_q3">
<input name="acerto1" type="radio">
<label for="">Blue</label>
</li>
<li id="pg1_q4">
<input name="acerto1" type="radio">
<label for="">Green</label>
</li>
</ul>
</div>
-JS
$('#perguntas-1 #pg1_q1').click(function () {
$('.block_question1 #pg1_q1').toggleClass('active_answers');
$("#pg1_q1 .selecionar").css({"visibility":"hidden"});
});
In short, I want you to click the buttao div and the value is inserted so that php recognizes the post
Obs: If I click on the radio button it works... if I click on the shape of the button it does not apply the value
You who are assigned a value to
input:radio
by clicking ondiv
or in the elementli
? Why don’t you assign the value toinput
?– Valdeir Psr
I didn’t really understand what you want. It’s for clocar na
li
or in thediv
? And after clocar you want theRadio
be as the attributeChecked
that’s it?– hugocsl
I just needed to hide the ball radio, and when clicking on div it inserts value.... when I hide with
visibility:hidden
the value to function...– Nathan