$('#save').click(function(e){
//alert('hi');
e.preventDefault();
$.ajax({
type: "POST",
url:"/customerdetails/" + $('#company_name').val().replace(/ /g,'_') + "/",
dataType: 'json',
data: {'customer':$('#company_name').val()},
success: function(data){
//alert($('#company_name').val());
//alert('f');
//alert(data.tag);
if(data.tag){
alert("Company with the same name already exists.");
$('#company_name').val('');
return true;
}
}
//return false;
});//end of submit
//return false;
});
위의 코드를 사용하면되지만, 기본값을 사용하고 있지만 작동하지 않으려는 것은 무엇이든 사용하려고합니다. 기본값을 벗어날 수 없습니다.
이return false;
에
e.preventDefault();
변경 return true;
를 제거하거나 제거 ... 난 당신이 필요로 정확히 모르겠지만 나에게
질문에 대해 더 자세히 설명해 주실 수 있습니까? –
나는 내 아약스 게시물에서 기본값을 사용하지 않으려 고하지만 버튼을 클릭 할 수없는 것들을 수행 한 후에 기본적으로 버튼은 기본적으로 금지되어 있습니다. – Raajsupra