1
Is there any way to remove fields with definite in Jquery?
I have the code below via Javascript, when I do an Input recording the date in the database, I need the button and the input to disappear, permenecending only the date inputada:
<td>
<?php echo $fetch['data_protocolo']; ?>
<br>
<br>
<input name="protocolo" id="protocolo" type="text" placeholder="" style="width:100px;font-size: 13px" class="form-control input-md">
<br>
<input id="btn" type="submit" class="btn btn-primary" value="OK" />
</td>
<script>
var btn = document.getElementById('btn');
btn.onclick = function () {
document.getElementById('protocolo').remove();
this.remove();
};
</script>
The above code works, but if I update the page, the buttons come back. There would be some way to remove the fields permanently?
The
<?php echo $fetch['data_protocolo']; ?>
is empty initially, before you make the Submit?– Sam
There is a structure in While that brings all the information from the database. Initially the Protocol Date field is empty, and then filled in. Once filled, I need the elements to be summarized (Input Text and Submit). And the ones that have not been filled, remain.
– user54154
It is not enough to just disappear with the input and the button, you should also avoid new connection.
– user60252