• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The Onchange Event is Not Fireing for My Input Tag

 
Steve Dyke
Ranch Hand
Posts: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64173
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • 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: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • 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: 1602
1
  • 0
  • Mark post as helpful
  • send pies
  • 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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic