Detecting a form change. Is jQuery the way to go? I have got a form with quite a lot of checkboxes (can go up to the 100's) in a table and I would like to detect if a checkbox has been clicked by the user.  If they have, I would like to automatically display a warning in the form informing the user that they need to save the form if they want the changes to take effect.  Similar to how the draggable tables in Drupal work.  Anytime, a form element changes, then, show a warning.

My question is, will using jQuery to attach a change event on each checkbox take a major performance-hit?  Is there a faster Drupal way to do it?  Will using the Drupal way, make performance faster?
Will using jQuery to attach a change event on each checkbox take a major performance-hit?


Probably, but it depends on the client's configuration. I have a form with around 3 hundred of controls, half of them hidden, some of them auto-copying content using jQuery, and sometimes FireFox has it's problems with it.


  Is there a faster Drupal way to do it?


Nope, Drupal way is to use Behaviors, or states, and Behaviors &amp; states thou shalt use... but they are merely Drupal's way to initiate jQuery-based code.


  Will using the Drupal way, make performance faster?


Nope, as Drupal way is basically jQuery way too. But it will merely allow you to be reasonably sure that other modules will not interfere with your code (without any significant slowdown).