5
I have the following buttons:
Below the button INCLUDE, has a button ETCH, that is set as HIDE():, when I click the button INCLUDE, I want the include button to be set as HIDE();, and the button ETCH as SHOW();.
$(function () {
setDisabled(true);
$("#IniciarTarefa").on("click", function (e) {
$("#IniciarTarefa").hide();
$("#submeter").show();
e.preventDefault();
setDisabled(false);
});
$("#FinalizarTarefa").on("click", function (e) {
e.preventDefault();
setDisabled(true);
});
function setDisabled(state) {
$('.desabilita input,select,textarea, checkbox').each(function () {
$("#submeter").hide();
$(this).prop("disabled", state);
});
}
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<button class="btn botoes" type="submit" id="IniciarTarefa" name="IniciarTarefa">
<img src="~/Content/iconBtn/novo_16x16.png" />
Incluir
</button>
<button class="btn botoes" type="submit" for="frmCliente" id="submeter" name="IniciarTarefa">
<img src="~/Content/iconBtn/gravar_16x16.png" />
Gravar
</button>
That way, the button ETCH, is coming set as HIDE(); and when I click on INCLUDE, the same disappears, but the save button does not appear. Someone knows why?
Possible duplicate of Show/Hide button
– LeAndrade