title: passing values of dropdown to textbox
body: <p>I have got a dropdownlist, a submit button and a textbox in my view. I want to pass the selected value of dropdownlist to the textbox when the submit button is clicked or onChange event of dropdownlist. How can I achieve this????</p>
  
  <p>I solved it as follows:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(function() {
          $('#ddlComp').change(function() {
              var selectedValue = $(this).val();
              $('#txtCompName').val(selectedValue);
          });
      });
  &lt;/script&gt;
  
  &lt;div&gt;
      @Html.DropDownList("ddlcomp", Model.CompanyList)
      &lt;input type="submit" value="Submit" /&gt;    
      @Html.TextBox("txtCompName")
  &lt;/div&gt;
  </code></pre>