Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

The Onchange Event is Not Fireing for My Input Tag

 
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an input tag that is readonly and an onclick method that requests a calendar form. When the user click a date the input tag value changes to the selected date. I also have an onchange method that I need to fire to make an ajax request. This onchange event is not fireing.
 
Sheriff
Posts: 67637
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As the user cannot change the value of a read-only field, a change event can never trigger.
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:As the user cannot change the value of a read-only field, a change event can never trigger.



Thanks Bear. I figured it was something like that. I will have to figure out another solution.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Steve Dyke wrote:I have an input tag that is readonly and an onclick method that requests a calendar form. When the user click a date the input tag value changes to the selected date. I also have an onchange method that I need to fire to make an ajax request. This onchange event is not fireing.



onchange does not fire when JavaScript sets the value.

Doesn't the calendar have a callback method or an event it triggers?

Eric
 
Steve Dyke
Ranch Hand
Posts: 2140
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Eric Pascarello wrote:

Steve Dyke wrote:I have an input tag that is readonly and an onclick method that requests a calendar form. When the user click a date the input tag value changes to the selected date. I also have an onchange method that I need to fire to make an ajax request. This onchange event is not fireing.



onchange does not fire when JavaScript sets the value.

Doesn't the calendar have a callback method or an event it triggers?

Eric



Yes, I figured out that I can just call the method I need at the calendar click event.
 
F is for finger. Can you stick your finger in your nose? Doesn't that feel nice? Now try this tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic