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

131
Visualizações
insert necesarry file to visible table in rgbDiv section

So I trying to display hidden division/section after user upload necessary file (in this case 3 files) but where do I need to use onchange javascript? here mine so far

html

<body onload="rgbOrMulti()"> 
<div style="padding: 14px 16px;">
<form action="/action_page.php">
<p>Red tif</p>
<input type="file" name="RedBand" accept=".tif" id="redBand" onchange="rgbOrMulti()">
</form>
<form action="/action_page.php">
<p>Green tif</p>
<input type="file" name="GreenBand" accept=".tif" id="greenBand" onchange="rgbOrMulti()">
</form>
<form action="/action_page.php">
<p>Blue tif</p>
<input type="file" name="BlueBand" accept=".tif" id="blueBand" onchange="rgbOrMulti()">     
</div>

<div id="rgbDiv">
<form action="/action_page.php">
<p>Red tif</p>
<input type="text" name="filename" accept=".tif">
</form>
<form action="/action_page.php">
<p>Green tif</p>
<input type="text" name="filename" accept=".tif">
</form>
<form action="/action_page.php">
<p>Blue tif</p>
<input type="text" name="filename" accept=".tif">       
</div>
</body>

javascript

function rgbOrMulti() {
    if (document.getElementById('redBand').files.length != 0 && getElementById('greenBand').files.length != 0 && getElementById('blueBand').files.length != 0) {
      alert(blueBand.value);
        document.getElementById('rgbDiv').style.visibility = 'visible';
        document.getElementById('multiDiv').style.visibility = 'hidden';
    } else if(document.getElementById('redtif').files.length != 0 && document.getElementById('greentif').files.length != 0 && document.getElementById('bluetif').files.length != 0) {
      document.getElementById('multiDiv').style.visibility = 'visible';
        document.getElementById('rgbDiv').style.visibility = 'hidden';
    }
    else{
      // none file insert 
    }
  }

how do i onchange the division rgbDiv to to visible properly??

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You try to set the visibility of these elements to visible with JavaScript, but your css still hiding them with display:none.

Either remove your css, or change the display property instead of visibility

about 4 years ago · Juan Pablo Isaza Relatório
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