1
I do not know if there is such a possibility, but I would like to know if it has to execute a certain action after the action of change
of a select
.
Let’s assume I have one select
thus:
<select name="meuSelect" id="meuSelect">
<option value="0">Selecione</option>
<option value="1">Primeiro item</option>
<option value="2">Segundo item</option>
</select>
and with jQuery for me to perform something when the user selects an item I get like this:
$(document).ready(function() {
$("#meuSelect").change(function() {
// executa uma ação qualquer
console.log('executou tudo por exemplo');
});
//somente executar a proxima ação após ter concluido tudo do 'change'
//pensando que essa ação do change esta em outro arquivo
//e esta sendo chamado por um $(seletor).on('change', function(){});
//coloquei aqui somente como exemplo, mas o change aqui não existe
console.log('Agora sim');
});
I hope I was clear in the comments, explaining a little better my problem
Marcelo, I noticed from the comments of the answer given by João Paulo that what you are doing is an asynchronous request. In this type of request your callback code must be right after the request to the server or it will not work properly.
– Geison Santos
The next post might help you: http://answall.com/questions/2232/howto perform a function
– Geison Santos