I have a form with 3 options, 3 radio.
If option 1 is checked, form1 appears, and so on.
Each radio is inside a div, that is, if I click on the div, it checks the radius.
My problem is, if I click on the radio ... the correspodent form appears, but if I click on the div, it checks the radius but the form does not appear.
My html and js are like this, below:
HTML
<form id=form>
<div id=conteiner>
<input type=radio name=opcao value="A" id=form1>
</div>
<div id=conteiner>
<input type=radio name=opcao value="B" id=form2>
</div>
<div id=conteiner>
<input type=radio name=opcao value="C" id=form3>
</div>
</form>
<form action="form1.php" method=post id=A style="display:none;">
<input type=text>teste1
</form>
<form action="form2.php" method=post id=B style="display:none;">
<input type=text>teste2
</form>
<form action="form3.php" method=post id=C style="display:none;">
<input type=text>teste3
</form>
JS
$(document).ready(function(){
$('#form-planos').change(function() {
if ($('#form1').prop('checked')) {
$('#A').show();
$('#B').hide();
$('#C').hide();
} else {
if ($('#form2').prop('checked')) {
$('#B').show();
$('#A').hide();
$('#C').hide();
} else {
$('#A').hide();
$('#B').hide();
$('#C').show();
}
}
});
});
$("#conteiner").live("click",function(event) {
var target = $(event.target);
if (target.is('input:radio')) return;
var checkbox = $(this).find("input[type='radio']");
if( checkbox.attr("checked") == "" ){
checkbox.attr("checked","true");
} else {
checkbox.attr("checked","");
}
$("div.assinatura").click(function () {
$('input:radio').attr('checked',false);
});
});
$(function(){
$('table').on('click', 'td', function(){
$(this).parent().children().removeClass('active');
$(this).addClass('active');
});
});