title: jQuery textbox change event doesn't fire, mvc
body: <p>I am trying to fire a method in JQuery, but it won't work.</p>
  
  <pre><code> @using (Html.BeginForm("AddOrUpdateMethod", "Controller", FormMethod.Post))
  {
       //some code
       &lt;div class="row"&gt;
  
              &lt;div class="period-list"&gt;
                  &lt;span class="advance-season"&gt;
                      &lt;span class="glyphicon glyphicon-warning-sign margin-right10"&gt;&lt;/span&gt;Something
                  &lt;/span&gt;
                  @for (int i = 0; i &lt; Model.Periods.Count; i++)
                  {
                      &lt;div class="form-group period"&gt;
                          @Html.HiddenFor(model =&gt; model.Periods[i].Id, new { @Value = Model.Periods[i].Id })                            
                          &lt;div class="pull-left inline-block col-xs-5 col-sm-5 col-md-5 col-lg-5"&gt;                                
                              &lt;div class="text-box-with-icon calendar margin-bottom10"&gt;
                                      @Html.TextBoxFor(model =&gt; model.Periods[i].From, "{0:dd/MM/yyyy}", new { @class = "form-control period-from", @onchange = "periodChange();" })                                    
                                  &lt;span class="icon"&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                          &lt;div class="pull-left inline-block col-xs-5 col-sm-5 col-md-5 col-lg-5"&gt;                              
                              &lt;div class="text-box-with-icon calendar margin-bottom10"&gt;                                   
                                      @Html.TextBoxFor(model =&gt; model.Periods[i].To, "{0:dd/MM/yyyy}", new { @class = "form-control period-to" })
                                  &lt;span class="icon"&gt;&lt;/span&gt;
                              &lt;/div&gt;
                          &lt;/div&gt;
                   }
                   //some code
              &lt;/div&gt;
         &lt;/div&gt;
  
  }
  </code></pre>
  
  <p>And my jQuery:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function periodChanged() {
      $('.period-from .period-to').change(function () {
          alert("click");
          //some code
     });
  }
  </code></pre>
  
  <p></p>
  
  <p>As you can see I tried already adding @change to textBox control. Nothing is happening. Maybe I should mention as well, that i I am using validation on model.Periods.From and model.Periods.To. Moreover this view is a partial view.</p>
  
  <p>EDIT:
  I changed into: </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready( function () {
      $('.period-from .period-to').click(function () {
          alert("click");
          if (Model.Periods.All(p=&gt;p.To.Day - p.From.Day + 1 &lt;= 7)) {
  
          }
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>but it still doesn't work.</p>