aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes The Onchange Event is Not Fireing for My Input Tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "The Onchange Event is Not Fireing for My Input Tag" Watch "The Onchange Event is Not Fireing for My Input Tag" New topic
Author

The Onchange Event is Not Fireing for My Input Tag

Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1478
    
    1
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

Joined: Jan 10, 2002
Posts: 61654
    
  67

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


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Steve Dyke
Ranch Hand

Joined: Nov 16, 2004
Posts: 1478
    
    1
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

Joined: Nov 08, 2001
Posts: 15376
    
    6
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

Joined: Nov 16, 2004
Posts: 1478
    
    1
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.
 
Don't get me started about those stupid light bulbs.
 
subject: The Onchange Event is Not Fireing for My Input Tag