Schleid Alex

Schleid Alex

  • NA
  • 361
  • 47.9k

Getting the selected value html.dropdowlist with jquery

Feb 19 2020 8:56 AM
Hi
 
I am trying to put the selected value of the html.dropdownlist in a hidden input using the following jquery script but it is not working
 
    <!-- Inject Script Filtered -->
 
the dropdownlist in the view is:


    @Html.DropDownList("StoreCategoryID", ViewBag.Category as SelectList, "Please select a Category", new { Onchange = @"form-submit" })

 
Catid = Id of the input tag.
 
Why it is not showing in the input tag?
I would also like to display the related product on a table without having to post the form and the html.dropdownlist to retain it state.
Or if posting the page is easier I am ok with that too.
 
Any help please
 
Schleid
 

Answers (5)