Ok! So I have this survey project I'm working on where there are a list of questions but only one shows up at a time.
That part's easy. And, it is fully functional as we speak (and I think even 'live') however..... My boss wants to be able to have the survey go to the next question when a user selects an answer. This part is easy.. except..... IE doesn't fire the onChange event until the radio button group has lost focus. So if you just rely on the onChange event, the user has to make 2 clicks (in firefox, the onchange fires when you change the which option is selected) so, I thought.. I'll just make it so when the option is focused, I immediately blur it so IE fires the onchange event. This works! Unfortunately, it breaks keyboard access to the form. Troublesome. So, I thought.. how about just making it so it fires onclick! Well, the problem with that is that in both IE and Firefox, when you use the keyboard to change which option is selected, it fires the onclick event! So far, I haven't been able to differentiate this particular event between a 'real' click and a keyboard-initiated onclick event (in either browser). I've sorta given up, and my boss went with the 'easy clicking for mouse users' option and said 'screw accessibility', and I pretty much agree with him.. but there's gotta be some way to do this :) So here's my question... anyone know how? What events should I listen for? What do I need to check in those events to tell if I'm being triggered by someone actually clicking with their mouse, or using the keyboard to select the answer. When all is said and done, I'm going to post a howto about this up on the web, as I'm sure stuff like this comes up from time to time... if nothing else I think it might be useful to someone.. hehe Thanks! -Jeremy
pgpd2ZN4PbSPb.pgp
Description: PGP signature
_______________________________________________ Rails-spinoffs mailing list [email protected] http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs
