-1

I have radio button field and it has default selected value, so how to trigger on change event without changing any radio button value when page loads. In my app I need to disable few dropdowns based on default selected radio button value

user2529774
  • 37
  • 3
  • 7

1 Answers1

1

you can use do like...

when page loads

$(document).ready(function(){    

//On page load, here you can check your radio button value
var val= $('input[name=name_of_your_radiobutton]:checked').val();

//on the basis of val you can add logic
dowork()

});

You can put your common logic into some function...

function dowork()
{
  //put your common logic here
}

Now you can call this method(dowork) on both event(Page Load and Radio Button change event)

mukesh kudi
  • 719
  • 6
  • 20
  • Thanks for reply, but am looking for something to write common functions for both page loads and radio button selected or changed – user2529774 Oct 09 '18 at 18:27