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

139
Visualizações
how to use plain javascript to get neighbor cell value when click a table cell?

I create a jsp. It will call AJAX and create table based on return data. The table include a textbox.
Now I want to add an onchange event for the textbox, it will compare it's value to a neighboring cell, I wrote the function but don't know how to get the cell value.

<script language="javascript">
    function btnclickdwr() {        
        var cellFuncs = [
                function(data) {
                    return data.matnr;
                },
                function(data) {
                    return data.amt;
                },              
                function(data) {
                    return "<input onchange='check_available()' value='" + data.menge
                            + "'></input>";
                } 
                }
        ];
        var p1=document.getElementById(P1).value;
        getAMT.Query(p1, function(data) {
            if (typeof window["DWRUtil"] == "undefined") {
                window.DWRUtil = dwr.util;
            }
            dwr.util.removeAllRows('openWinBody'); /
            DWRUtil.addRows("openWinBody", data, cellFuncs, {
                escapeHtml : false
            })
        })
    }
function check_available()
{}
</script>
<body>
<input id="p1">
<button onclick='btnclickdwr()>click</button>
<div class="divcss1">
        <table id="SS" width="80%"
            style="border-collapse: collapse; margin: 0 auto; text-align: center;">
            <thead>
                <tr>
                    <th style="">material</th>
                    <th style="">available amount</th>
                    <th style="">withdraw amount</th>           
                </tr>
            </thead>
            <tbody id="openWinBody">
            </tbody>
        </table>
    </div>
</body>

Any hint? Thx.

about 4 years ago · Santiago Gelvez
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