Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hidden input change event

Tags:

How can I detect a change of the value of a hidden input? I've already tried these approaches without success:

$('#id_inpout').live('change',function () {         var id_el = $(this).attr('id');         alert(id_el);     }); 

and

$('#id_inpout').change(function () {         var id_el = $(this).attr('id');         alert(id_el);     }); 

and

$('#id_inpout').bind('change',function () {         var id_el = $(this).attr('id');         alert(id_el);     }); 
like image 797
chokrijobs Avatar asked Sep 25 '12 10:09

chokrijobs


1 Answers

You could also use trigger('change') after you assign new value to the hidden input:

$('#hidden_input').val('new_value').trigger('change'); 
like image 196
Alex Avatar answered Oct 01 '22 14:10

Alex