title: How to pass value from javascript to controller?
body: <p>I have JavaScript code :</p>
  
  <pre><code>&lt;script&gt;
      function ChangeRegion()
      {
          var countryId = document.getElementById("country").value;
  
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>I have textbox on my view:</p>
  
  <pre><code>@Html.DropDownListFor(m =&gt; m.Register.SelectCountryId, Model.Register.Country, "Select country", new { id = "country", @class = "form-control",@onchange="ChangeRegion();" })
  </code></pre>
  
  <p>Now i need on change to pass value to my controller to get Regions</p>
  
  <p>my controller:</p>
  
  <pre><code> model.Register.Region = new SelectList(manager.GetRegions(model.Register.SelectCountryId), "Id", "Name");
  </code></pre>
  
  <p><strong>EDIT: this is my controller for post :</strong></p>
  
  <p>when i choose country and click submit button i get values for raegions but i need to get values without submiting form</p>
  
  <pre><code>model.Register.Country = new SelectList(manager.GetCountries(), "Id", "Name");  
  model.Register.Region = new SelectList(manager.GetRegions(model.Register.SelectCountryId), "Id", "Name");&lt;-- i want to put here that id from javascript
  model.Register.WebTypeOfLicense = new SelectList(CommonDbService.GetAllLicense(), "Id", "Name");
  model.Register.City = new SelectList(manager.GetCities(model.Register.SelectRegionId), "Id", "Name");
  return View(model);
  </code></pre>