
Untitled
By: a guest on
May 12th, 2012 | syntax:
None | size: 1.87 KB | hits: 18 | expires: Never
Button is overriding/conflicting with another button on the same webpage
<input id="show_hint" class="button" type="submit" value="Hint" onClick="location.href='#hint'" />
// Button 1
$(function(){
var count = 3,
$btn = $('input[type="submit"]');
$btn.val($btn.val()+' ('+count+')')
$btn.click(function(){
$btn.val($btn.val().replace(count,count-1));
count--;
$('#hintscore')
.hide()
.css({
bottom: 30,
left: 300,
opacity: 1,
})
.show()
.stop()
.delay(200)
.animate({'bottom':75, opacity: 0},1000);
if(count==0) {
return !$btn.attr('disabled','disabled');
}
})
});
<input id="showmenu_win2" class="button" type="submit" value="Menu" />
$('#form').submit(function() {
$.ajax({
type: "POST",
data: $("#form").serialize(),
cache: false,
url: "insert.php"
});
return false;
});
$btn = $('input[type="submit"]');
$btn = $("#show_hint");
$btn = $('input[type="submit"]');
$btn = $('#show_hint');
$btn = $('#ancestor-element').find('input[type="submit"]');
$btn = $('input[type="submit"]').not($('#form').find('input[type="submit"]'));
<input id="show_hint" class="button" type="button" value="Hint" onClick="location.href='#hint'" />
$(function(){
var count = 3,
$("#show_hint").val($(this).val()+' ('+count+')')
$("#show_hint").click(function(){
$("#show_hint").val($(this).val().replace(count,count-1));
count--
// Your remaining code...
<input id="showmenu_win2" class="button" type="input" value="Menu" />
$('#showmenu_win2').click(function() {
$.ajax({
type: "POST",
data: $("#form").serialize(),
cache: false,
url: "insert.php"
});
return false;
});