title: Html.EditFor Onchange Event
body: <p>I am developing an MVC4 application.<br>
  I want to change <strong>IsChanged</strong>  field in my Model, when <strong>model.ExternalVenderNo</strong> is changed.</p>
  
  <p>Below are codes on View page </p>
  
  <pre><code> &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.ExternalVenderNo, new { @onchange = "OnChangeEvent();" })
          @Html.ValidationMessageFor(model =&gt; model.ExternalVenderNo)
      &lt;/div&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code> function OnChangeEvent()
  {
      alert("value is changed");
      @{ Model.IsChanged = true;
      }
  }
  </code></pre>
  
  <p>To check whether <strong>OnChangeEvent</strong> is being called , i put <strong>alert</strong>.
  But <strong>alert</strong> is also <strong>not working</strong>.<br>
   it means <strong>OnChangeEvent</strong> is not beign called.</p>
  
  <p>I just want to change <strong>IsChanged</strong>  field to true, when <strong>model.ExternalVenderNo</strong> is changed.</p>
  
  <p><strong>Model</strong> has <code>bool IsChanged</code></p>