> I think you don't have to use eval..., I'd try this:
>
> var select = $('[EMAIL PROTECTED] myselect]');
> var cachedOnChange = select[0].onchange;

I get the onchange in a function, great!

> select[0].onchange = null;

What is the difference between this and unbind('change') or removeAttr 
('onchange')?

> select.bind('change', function() {
>      if (confirm('Are you sure?')) {
>          cachedOnChange();

The function uses 'this', which is not "available" anymore when I  
call it...

>      } else {
>          ...
>      }
> });
>
>
> Does that work for you?

Almost, there is just the "this" issue to solve... thanks!


It would be nice to have .bindBefore() and .bindAfter() methods... ;-)


-Nicolas

-- 
Nicolas "Brush" HOIZEY
Clever Age   : http://www.clever-age.com/
Gastero Prod : http://www.gasteroprod.com/
Photos : http://www.flickr.com/gp/[EMAIL PROTECTED]/M1c002
phpHeaven    : http://www.phpheaven.net/




_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to