views:

32

answers:

1

How to use Jquery if any field is being changed using javascript?

I have hidden field whose value is being changed as per change of other field using javascript.

Now I want jquery event function which can track this change of hidden field and do the needful.

I tried with this :

jQuery("#bannersize").change(function()

but it didnt worked for me as i wanted.

How can i do it?

+3  A: 

The following should trigger a "change" event. Call this code after you change your hidden field value:

$('#bannersize').trigger('change');
MikeG
its not working or might be I am doing something wrong...
OM The Eternity
+1 Do u mean to place in below html code or above the jQuery("#bannersize").change(function()
OM The Eternity
I mean place it wherever you are changing your hidden field value (I'm assuming you have some javascript which changes your hidden field value?)
MikeG