You are viewing limited content. For full access, please sign in.

Question

Question

How to populate field when radio change?

asked on December 4, 2017

Hi all,

I want to auto populate a field1 when my radio's value is "c".

This is my code

 

$('Field2').change(function()
{
    if(document.getElementById('Field2').value = "Vinicard Classic")
       {
           document.getElementById('Field1').value = 0 ;
       }
 });

But I have nothing.

Someone can help me ?

0 0

Replies

replied on December 4, 2017 Show version history

Try this:

$( document ).ready(function() {
  
    $(document).on('click', '.type_vinicard input', popAppel);
  
  function popAppel() {
    
    var type = $('.type_vinicard input:checked').val();
    
    if ( (type == 'Vinicard Classic') || (type == 'c') ) {
      
      $('.appel input').val('0');
      
    }
    else
    {
      $('.appel input').val('');
    }
    
  }
  
  
});

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.