I have a form who gives data from database I have number type inputs. I want to hide and leave empty the input that displays "0", without replace it in database after submit.
I found how to do it with table cells. But not with inputs.
<script type="text/javascript">
var table = document.getElementById("myTable");
var cells = table.getElementsByTagName("td");
for (var i = 0; i < cells.length; i++) {
if (parseInt(cells[i].textContent, 10) === 0) {
cells[i].innerHTML = ' ';
}
}
</script>
Thx.