0

I write this event for RadioButton change event.but for first timer that page load.it doesnt work.why?

//html mvc code
    @Html.RadioButtonFor(m => m.DigitalFile, false) خیر
    @Html.RadioButtonFor(m => m.DigitalFile, true) بله

     <script>
    $(function () {
        $("input[name='DigitalFile']").change(function () {
        var $this = $(this);
        if ($this.val() == "True") {
            $("#MapZoning").attr("disabled", false);
        } else {
            $("#MapZoning").attr("disabled", true);
        }
        });
    });
</script>
tereško
  • 58,060
  • 25
  • 98
  • 150
Vahid Akbari
  • 189
  • 7
  • 25

1 Answers1

1

I didn't get your question. .but for first timer that page load.it doesnt work.why? If you are saying that when the page loads, the attribute of mapZoning doesn't change, then that's because you are only calling the function when some change occurs in your DigitalFile (i.e., someone, checks it or unchecks it)

Palash
  • 498
  • 4
  • 12