I have a very extensive template, and there is a form that updates the value of a text field with Javascript or Jquery, this function has not been able to locate it, and I need to detect when this field is updated, I have tried with all these functions, but it is not detecting when it is updated.
Can you help me find the reason, or some solution, why is not it detected when the field is updated from Javascript but is detected when updated when I write and click outside the field?
IMPORTANT: The 90,000 value that is added dynamically, makes it a specific function, which I have not been able to find and I urgently need to solve for time issues in the quickest and easiest way, and is to try detect if the value changed with Javascript and not with user actions.
$(function(){
/**
* Actualización automática del formulario, funcion no encontrada
* IMPORTANTE: $('#long').val('90.000').trigger('change') no puedo usar esto por que la
Funcion que agrega este valor no la he encontrado y es muy extenso el proyecto, quiero una alternativa rápida desde Javascript o Jquery
*/
setTimeout(function(){
// Value updated automatically
$('#long').val("90.000");
}, 2000);
/**
* Detecta cuando el campo es actualizado
*/
$('input#long').on('change', function(){
alert("Updated");
});
$(':input').on('change', function(){
alert("Updated");
});
$('input#long').change(function(){
alert("Updated");
});
$(document).on('change', 'input#long', function(){
alert("Updated");
});
$(document).on('change', 'input', function(){
alert("Updated");
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="long">