• 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

How do I get an event fired through javascript?

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Friends,

I have a text box 'myTxtBox' to which I have attached a calendar js. When I select a date from the calendar, it gets populated in the text box. But I also
have to call a function 'myFunc', when the value changes in the text box. But the function doesn't get called.

I think when you try to change the value of a text box through JavaScript, it only updates the DOM.

Please help me as to, how can I get the function called when the value of the text box gets changed through JS.

Thanks in advance for any help.
[ May 01, 2006: Message edited by: Bear Bibeault ]
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
put the funciton call in your calendar code.

Eric
 
Jayant Raj
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

I thought about putting the function call in the calendar. It is a third party component, so I can't make any changes to that.

I will try explaining the problem, in more detail.

1] I have a calendar control & a read only text field.
2] The user selects a date & it gets populated in the text box.
3] Now since the value in the text box has changed, I make a asynchronous call to a function 'myFunc' using AJAX to validate the date.
4] For this I have a {onchanged = 'myFunc'} for my text box. But this onchanged method doesn't get called.

Please, try to give me some solution.. as I am not very comfortable with JS.
 
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
The function is not going to get called since the onchange is only fired with user interaction. Only thing you can dois build some sort of listener that has a timer on it that checks to see if the value is different.
Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic