Gentlemen, I have a question in this part of my code:
I need to send a request and then disable the submit button. The Jquery code that does this is already working, but when I use it a second time, even changing the ID, it disables all the buttons on the page.
Does anyone have a clue what to do?
<div class="col-md-6">
<ul class="list-group">
<li class="list-group-item list-group-item-success">
<span class="badge"><b>Qua, 09 de Dez de 2015 02H:51M</b></span>
Última atualização de <b>Locais</b>
</li>
<form action="http://localhost/W-OS-PRO/index.php/local/atualizar">
<input type="submit" id="local" class="btn btn-success btn-sm btn-block" value="Atualizar base de dados" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scripttype="text/javascript">
$(window).on('beforeunload', function () {
$("input[id=local]").prop("disabled", "disabled");
});
</script>
</form>
<div></form>
<li class="list-group-item list-group-item-success" align="right">
<span class="glyphicon glyphicon-time" aria-hidden="true"></span> Este processo pode levar alguns minutos.</div>
</li>
</ul>
</div>
<div class="col-md-6">
<ul class="list-group">
<li class="list-group-item list-group-item-success">
<span class="badge"><b>Qua, 09 de Dez de 2015 02H:52M</b></span>
Última atualização de <b>Itens</b>
</li>
<form action="http://localhost/W-OS-PRO/index.php/item/atualizar">
<input type="submit" id="itens" class="btn btn-success btn-sm btn-block" value="Atualizar base de dados" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scripttype="text/javascript">
$(window).on('beforeunload', function () {
$("input[id=itens]").prop("disabled", "disabled");
});
</script>
</form>
<div></form>
<li class="list-group-item list-group-item-success" align="right">
<span class="glyphicon glyphicon-time" aria-hidden="true"></span> Este processo pode levar alguns minutos.</div>
</li>
</ul>
</div>
<div class="col-md-6">
<ul class="list-group">
<li class="list-group-item list-group-item-success">
<span class="badge"><b>Qua, 09 de Dez de 2015 02H:44M</b></span>
Última atualização de <b>Agentes</b>
</li>
<form action="http://localhost/W-OS-PRO/index.php/agente/atualizar">
<input type="submit" id="agentes" class="btn btn-success btn-sm btn-block" value="Atualizar base de dados" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script><scripttype="text/javascript">
$(window).on('beforeunload', function () {
$("input[id=agentes]").prop("disabled", "disabled");
});
</script>
</form>
<div></form>
<li class="list-group-item list-group-item-success" align="right">
<span class="glyphicon glyphicon-time" aria-hidden="true"></span> Este processo pode levar alguns minutos.</div>
</li>
</ul>
</div>