2010-04-21 5 views
0

마지막에 추가 된 모든 get 변수를 포함하여 제출시 GET 양식의 양식 조치를받을 수 있습니까?JQuery - GET 변수를 포함한 양식 작업?

내가 AJAX를 사용하여 양식이 제출되는 스크립트를 실행하고 감사 메시지를 표시하고자하는 이유.

답변

4

jQuery를 사용하면 매우 편리합니다. http://api.jquery.com/serialize/.

$('#your-form').bind('submit', function (event) { 
    jQuery.get('your-url.php', $(this).serialize(), function (response) { 
    alert("Woo"); 
    }); 

    event.preventDefault(); 
}); 
0
$('form').bind('submit', function(e){ 
    $.ajax({ 
     // ... 
     data: $(this).serialize(), 
     // ... 
    }); 
    e.preventDefault(); 
}); 
관련 문제