Forum OpenACS Q&A: [OT] using CSS to attach event handlers to controls

Does anyone know if it's possible to attach event handlers to objects using CSS (or some other simple site-global mechanism)? I've been thinking it would be easy to avoid specific double-click handling in every action page by giving the submit buttons an onClick handler that disables the button. Problem is manually adding that to every control is no more of a win than including double-click logic in the target page, but if CSS could be used to attach the handler then life suddenly gets much easier. I've found a W3C working draft that allows exactly this, but it hasn't been updated since '99 and doesn't seem to have been implemented by anyone. Is this possible? Am I barking up the wrong tree?
Collapse
Posted by Dave Bauer on
You can just change the form template you use to add the code you need.

I still think you have to have double click protection on insert to the database. It won't hurt to have something in the form as well, but the actualy code that does the inserts needs to also check.

If you use ad_form this is already done for objects if you use the key feature.