Get the value of a listed td (JSP)

0

Hey guys.

I'm making a system for college, I would like to know if you guys from the forum could solve a problem I'm experiencing.

My sell screen needs to pick up the unit price value that is in a table. The user can put the service he wants that is in a box, when clicking on the service need to automatically pull the unit price. What list my box is a c: forEach.

    

<section id="principal">
    <form name="formVendas" method="get" action= "" method="get">
        <h1>Vender</h1>
        <p><label>Nome do serviço:<select id="camposervico" class="tempNome" name="servico">
                    <c:forEach var="servico" items="${dao.listar()}">
                        <option name="${servico.nomeServico}">${servico.nomeServico}</option>
                    </c:forEach>
                </select></label>
            <label>Quantidade:<input type="text" class="tempQuantidade" name="quantidade"></label>
            <label>Preço Unitário:<input type="text" class="tempPrecoUnitario" name="precounitario" ></label>
            <label>Valor total:<input type="text" class="tempInsert"  value="" name="valortotal"></label>
            <button type="button" id="tempBtn" onclick="calcularTotal()">Adicionar</button>
        </p>

        <table width="100%">
            <thead>
                <tr>
                    <th>Serviço</th>
                    <th>Preço Unitário</th>
                    <th>Quantidade</th>
                    <th>Valor Total</th>
                    <th>Remover</th>
                </tr>
            </thead>
            <tbody></tbody>
        </table>



    </form>
</section>
<script src="./resources/bootstrap/js/bootstrap.min.js"></script> 

    
asked by anonymous 20.05.2017 / 16:00

0 answers