• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

onchange event

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The onchange event is triggered when the value is changed AND the input field is set out of focus.
But, if I want to to use it on a hidden field, i.e if I want to know when a hidden field is changed, how do i use it.
I have a hidden field that is updated by someother javascript function and I want to populate few fields based on the hidden field value.
Please throw me some light on this .
Thnaks,
Raji.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you can not call an onchange event without user interaction of the element.
You are already calling the javascript to change the value so why don;t you just call the other function then?
Eric
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Raji,
Can you just have your javascript that is populating the hidden field just perform the additional processing that you need?
You could always create an event then call document.handleEvent with the event you created.
 
Raji ram
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The other function that populates the hidden filed is not a function written by me. It is a common function provided by a third party. I pass in a the hidden field name as aparameter to that function.
Anyways, I will try to see if I can change that function.
Thanks,
Raji.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
if it is javascript, you should have no problem changing the function that was provided.....
If worse comes to worse you can set a interval to keep checking the value of the box and see if it changes, but that will cause poor performance with your page.
Eric
[ November 19, 2003: Message edited by: Eric Pascarello ]
 
Raji ram
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the response Eric.
I changed the javascript to do this.
Regards,
Raji.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic