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
Post a Comment