Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 14th, 2012  |  syntax: None  |  size: 1.17 KB  |  hits: 31  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. jQuery UI Button doesn't work after disabled/enabled from iframe
  2. $(function(){
  3.     $('button#submit').button({disabled:true});
  4.     $('button#submit').click(function(){
  5.         console.log('It works!');
  6.     });
  7.     $('a#button-enable').click(function(){
  8.         $('button#submit').button({disabled:false});
  9.     });
  10. });
  11.        
  12. $(function(){
  13.     $('button#submit').button("option", "disabled", true );
  14.     $('a#button-enable').click(function(){
  15.         $('button#submit').button("option", "disabled", false);
  16.         $('button#submit').click(function(){
  17.             alert('It works!');
  18.         });
  19.     });
  20. });
  21.        
  22. $(function() {
  23.     var button = $('#submit').button({
  24.         disabled: true
  25.     }).click(function() {
  26.         alert('It Works');
  27.     });
  28.     $('#button-enable').click(function() {
  29.         button.button('enable');
  30.     });
  31. });​
  32.        
  33. $(function{
  34.     $('button, input[type="submit"]').button();
  35.     $('button#submit').button('disable');
  36.     $(document).bind('enableButton',function(){
  37.         $('button#submit').button('enable');
  38.     });
  39.     $('button#submit').click(function(){
  40.         //...
  41.     });
  42. });
  43.        
  44. $(function(){
  45.     //...
  46.     parent.$(parent.document).trigger('enableButton');
  47. });