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

Untitled

By: a guest on May 12th, 2012  |  syntax: None  |  size: 1.87 KB  |  hits: 18  |  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. Button is overriding/conflicting with another button on the same webpage
  2. <input id="show_hint" class="button" type="submit" value="Hint" onClick="location.href='#hint'" />
  3.        
  4. // Button 1
  5. $(function(){
  6.   var count = 3,
  7.       $btn = $('input[type="submit"]');
  8.       $btn.val($btn.val()+' ('+count+')')
  9.  
  10.   $btn.click(function(){
  11.       $btn.val($btn.val().replace(count,count-1));
  12.       count--;
  13.       $('#hintscore')
  14.         .hide()
  15.         .css({
  16.             bottom: 30,
  17.             left: 300,
  18.             opacity: 1,
  19.         })
  20.         .show()
  21.         .stop()
  22.         .delay(200)  
  23.         .animate({'bottom':75, opacity: 0},1000);
  24.  
  25.       if(count==0) {
  26.             return !$btn.attr('disabled','disabled');
  27.       }
  28.   })
  29. });
  30.        
  31. <input id="showmenu_win2" class="button" type="submit" value="Menu" />
  32.        
  33. $('#form').submit(function() {
  34.         $.ajax({  
  35.             type: "POST",
  36.             data: $("#form").serialize(),
  37.             cache: false,  
  38.             url: "insert.php"  
  39.         });  
  40.         return false;
  41.     });
  42.        
  43. $btn = $('input[type="submit"]');
  44.        
  45. $btn = $("#show_hint");
  46.        
  47. $btn = $('input[type="submit"]');
  48.        
  49. $btn = $('#show_hint');
  50.        
  51. $btn = $('#ancestor-element').find('input[type="submit"]');
  52.        
  53. $btn = $('input[type="submit"]').not($('#form').find('input[type="submit"]'));
  54.        
  55. <input id="show_hint" class="button" type="button" value="Hint" onClick="location.href='#hint'" />
  56.        
  57. $(function(){
  58.   var count = 3,
  59.   $("#show_hint").val($(this).val()+' ('+count+')')
  60.  
  61.  $("#show_hint").click(function(){
  62.   $("#show_hint").val($(this).val().replace(count,count-1));
  63.   count--
  64.  
  65.  // Your remaining code...
  66.        
  67. <input id="showmenu_win2" class="button" type="input" value="Menu" />
  68.        
  69. $('#showmenu_win2').click(function() {
  70.     $.ajax({  
  71.         type: "POST",
  72.         data: $("#form").serialize(),
  73.         cache: false,  
  74.         url: "insert.php"  
  75.     });  
  76.     return false;
  77. });