Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

233
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda