asp.net mvc 4 - mvc 4 How to call javascript function after @Html.RadioButtonFor clicked -


view has :

<div monthly @html.radiobuttonfor(m => m.ddpaymentoption, "monthly", true)       yearly  @html.radiobuttonfor(m => m.ddpaymentoption, "yearly", true)   </div> 

tried

$(":radio").click(function () {      var selectedvalue = $(this).val();     var isdiv = document.getelementbyid('instalmentschedulediv');      if (selectedvalue == "yearly")     {         isdiv.classname =  "hidediv";     } }); 

does not hit function

use code

$('#ddpaymentoption').click(function(){            if($(this).val()=='yearly')           {              $('#instalmentschedulediv').addclass('hidediv');          }  }); 

and if using hidediv class hide div can jquery methods show or hide div element

$('#instalmentschedulediv').hide(); // hide element 

and/or

    $('#instalmentschedulediv').show(); // show element 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -