In article <aa57bfd3.0309251549.7764428e (AT) posting (DOT) google.com>, swickes (AT) rof (DOT) net
(S Wickes) writes:
Quote:
BUT! Some users report that, if they don't take their cursor out of
the last text box they were editing, the text in that last textarea
does not get written to the database. (In other words, the onchange
event in that last textarea never got triggered.)
My question: With some browsers, if you leave your cursor parked in
the last box you were editing, and then press submit, why is onChange
not being triggered? |
What you are experiencing is a timing issue.
Cursor is in text area, mouse pushes down on the Submit button, the onChange
gets fired, the form gets submitted. If the form happens to get submitted
before JS has time to mark the field as changed, you get the behavior you
describe.
Without going into a diatribe about relying on javascript, one possible
solution is instead of a submit button, use a normal input type=button and set
its onclick to call a function that will setTimeout to wait 300 ms or so, and
then programatically submit the form. You would be surprised how much
javascript can get executed in 300ms.
--
Randy