이 바이올린 제발 봐 :제출 단추는 예제에서 두 번 누르면 작동합니까?
을 버튼을 한 번 누르면 제출하면, 그것은 뚜렷한 이유없이 텍스트 편집을 제거하지만 아무것도하지 않지만, 두 번째는,이 작업을 수행 누르면 페이지로 이동합니다.
이 코드를 작성하는 데 도움을주십시오. 코드의 말씀
$('b.edit').click(function() {
$(this).hide().after('<form action = "foo.php" method = post><input hidden name = "field" type = "text" value = "' + this.id + '"/><input type="text" name = "period" class="editP" value="' + $(this).html() + '" /><input type = "submit" value = "Submit!!" /></form>');
$('.editP').focus();
});
$('.editP').live('blur', function() {
$(this).hide().prev('b.edit').html($(this).val()).show();
});
그는 절대적으로 맞습니다. '.hide()'의 두 경우 모두 제거해보십시오. – BumbleB2na
@Marcus는'.hide()'를 보존 할 수있는 방법이 있지만 아직 이것을 유지하고 있습니까? –