简体   繁体   中英

Onchange is not working with Javascript entry

I have a form with some dates to be filled in. I'm using Cold Fusion, but here am using just the form and input tags, not the "enhanced" CF tags. The user can select these dates only from a Javascript calendar. The calendar works fine, the dates get filled in, the Javascript function "validx" is working, but the onchange does not fire with this data entry method.

<input 
  type     = "text" 
  id       = "#colid#"
  class    = "calendarSelectDate"  {this fires the calendar}             
  name     = "#col#" 
  readonly                         
  onclick  = "tooltip(#i#)"
  onchange = "validx(#i#, #top#, '#thecase#', '#themsg#')"
  value    = "#sv#" >

I can get onblur to do the job, but would really prefer onchange. Anyone have a way to do this? Thanks.

I believe you are misunderstanding the purpose of onchange . This event fires when the user blurs the checkbox after making a change. By definition it requires a blur. Perhaps you should look into onkeyup or similar events involving keypresses.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM