radio input selection to point to a form

0

How can you access a form by selecting inputs radios?

I have this example but it does not work for me

<input name="tabs" checked type="radio" data-target="#fisica">Persona Física
<input name="tabs" type="radio" data-target="#moral">Persona Moral
<input name="tabs" type="radio" data-target="#extranjero">Proveedor Extranjero

<div class="tab-content">
 <div id="fisica" class="tab-pane active schedule-pane">
   <form  id="personaFisica">
      <input type="text" name="prueba">aaaa
   </form>
 </div>
  <div id="moral" class="tab-pane active schedule-pane">
   <form  id="personaMoral">
      <input type="text" name="prueba">aaaa
   </form>
 </div>
</div>
    
asked by angusacsdc120789 21.06.2018 в 17:37
source

1 answer

0

Add ID to each radio and add the following:

    $('#radioFisica').click(function(){
      $('.tab-pane').removeClass('active');
      $('#fisica').addClass('active');
    });

  $('#radioMoral').click(function(){
      $('.tab-pane').removeClass('active');
      $('#moral').addClass('active');
    });
    
answered by 21.06.2018 в 17:53