Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

135
Views
Updating the ListBox values in MVC on event change

I have a DropDownListFor and ListBox as defined below in my Razor view.

@Html.DropDownListFor(m => m.drpid, new SelectList(Model.List,"value","text",Model.DDselected))
@Html.ListBox("lstid", new MultiSelectList(Model.List2,"value","text",Model.LBselected))

Now when the dropdown value is changed i want to listbox item to be updated accordingly.

I have used change function of jQuery as below

$("#drpid").change(function() { ........ }

Now in this change function I want to assign the values present inside array (1,2,3) to be selected in ListBox and I am unable to do so. Could you please help me in updating/resetting the ListBox values using jQuery/javascript in this change function.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!