funeralcrasher: (Default)
funeralcrasher ([personal profile] funeralcrasher) wrote2008-04-09 11:06 am

Trigger action when form input text changes

So is there a way for Javascript to detect when a textbox changes, before onBlur?

I thought onChange would work, but it seems to act just like onBlur: http://www.sunybroome.edu/~hinton_r/js/blurchangeframe.html (comparison of onBlur and onChange in same page)


[identity profile] pkbarbiedoll.livejournal.com 2008-04-10 04:20 am (UTC)(link)
I ended up with onKeyPress to check to see if the textarea is blank. It works perfectly for my needs.

[identity profile] bedivere.livejournal.com 2008-04-10 02:55 pm (UTC)(link)
Ah.. right on then. I used that once for a client that wanted all input values to db saved to the database in all uppercase (for reasons too inane to go into), so I hadda trap that and convert character typed to uppercase.