0
I have a table that lists the customers of a company. The user selects the client he wants through the links in each. By clicking the table data feed the form inputs. Only now I want to hide the table, since the user has already selected the record that would like.
The table I list so:
<table class="table" id="tabelaCliente">
<tbody>
<tr>
<th>
<i>
Cliente
</i>
</th>
<th>
<i>
Telefone
</i>
</th>
</tr>
<?php
foreach ($query as $linha) {
?>
<tr>
<td id="<?php echo $linha->id ?>"> <a href=""><?php echo $linha->nome ?></a></td>
<td><?php echo $linha->telefone . ' ou ' . $linha->celular ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
To feed form inputs I use AJAX:
$(document).on("click","#tabelaCliente td a",function(e){
e.preventDefault()
var id_cliente = $(this).parent().attr("id");
$('#nome').val($(this).text());
// para ocultar eu faço
$('#tabelaCliente').hide('slow');
// já tentei isso também
// document.getElementById('tabelaCliente').style.display = "block";
});
My problem is in hiding the table, it won’t... Does anyone know how to do?
Try $("#tableClient"). css("display", "None"); and to display it again if you need $("#tableClient"). css("display", "block"); ie None hides and block displays.
– Rafael Salomão
Thanks, it worked out
– Rafael Christófano
Quiet Rafa, luck there !
– Rafael Salomão