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

232
Views
Making a Select Option item revert to original state using React?

First time posting here. I'm a newer developer, and I'm working on building a navigation system using a series of 4 select-option menus, and each time you select a previous one it enables the following drop down list.

World Wide | MDC | Shelf | Unit

...............................................................

New Jersey.... 10..........12....... 42

Ohio................. 08........ 34.........23

On "World Wide", the MDC, Shelf, and Unit drop downs are disabled. If you pick from locations, like New Jersey then it opens up the MDC list, and once one of those is picked the shelf menu is unlocked and so on... Well so far, everything seems functional, except for when I go back to picking a different location like "Ohio". I want the MDC drop down list to default back to "MDC", and the other drop downs to disable (this part works). However, the MDC will stay on the value selected there, and as the list is loaded dynamically it doesn't always sync and it just looks like trash.

Here is the code for the first two select menu items Location and MDCs.

<select name="site" id="site" onChange={selectSiteHandler}>
        <option value="00" defaultValue>
          World Wide
        </option>
        {jobSites && jobSites.map((site, key) => {
          return <option value={site.physical_site_name} key={key + 1}>{site.physical_site_name} - 10</option>
        })}
      </select>
      <select
        name="mdc"
        id="mdc"
        onChange={selectMdcHandler}
        disabled={mdcDisabled}
      ><option value="00" defaultValue>
      {mdcDefaultVal}
    </option>
        {!mdcDisabled && dropdownFormatter(assetList, "mdc", site).map((mdc, key) => {
          return <option value={mdc} key={key + 1}>MDC {mdc}</option>
        })}
      </select>

I've tried changing the mcdDefaultVal to no avail.

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!