title: Updating Textbox's info upon selecting listbox item using javascript
body: <p>I'm trying to update Textbox's with the selected items info(properties). Can I get the selected Items Name instead of the Id, or in other words how can I get the properties of whats in my ViewData in the javascript upon selecting an item and then set it to a txtbox?</p>
  
  <pre><code>         @Html.ListBox("ListBoxName", new SelectList((IEnumerable&lt;Epic&gt;)ViewData["selectedestimate"], "Id", "Name", "EstimatedTime"), new {@class = "ListBoxClass", @style = "height: 325px;"})
          @Html.TextBoxFor(model =&gt; model.Name, new {@class = "TimeClass"})
  
  
  
     &lt;script type="text/javascript"&gt;
           $(function () {
             $(".ListBoxClass").click(function (event) {
          var selectedid = $(this).find("option:selected").val();
  
           // get items properties and info so that the value can be set to a textbox
          //set textbox value to Name of selected Value
          $(".TimeClass").val(selectedid);
          event.preventDefault(); // Stop the browser from redirecting as it normally would
          $.get('@Url.Action("UserStoriesList", "Estimate")', { id: selectedid }, function (result) {
              $('#stories').html(result);
          });
      });
  });
      &lt;/script&gt; 
  </code></pre>