• 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

The Onchange Event is Not Fireing for My Input Tag

 
Ranch Hand
Posts: 2206
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: 67746
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: 2206
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: 2206
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.
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic