2010-11-25 4 views
0

이것은 게시물이 보이는 것과 같습니다. 데이터가 숨겨진 양식 인 'area'div에 반환 데이터를 "인쇄"합니다. 입력 유형 = '숨김'ID입니다. = 'pc1'value = 'wh5', id 'pc1'값을 얻을 수 있습니까?, 지금은 'undefined'가됩니다. 라이브를 사용합니까? 나는 그것들을 살펴 보았지만 그것들은 클릭 이벤트를위한 것으로 보인다.jquery .post를 통해 양식 변수를 전달합니다.

$("#chk").click(function(){$.post("includes/mainform_new.php",{ 

postcode:$("#postc").val() 

}, 

    function(data){ 

     $("#area").html(data); <--- the input element pc1 is in the returned data 

     alert($("#pc1").val()); <--- returns undefined 

     }); 


}); 

답변

1

이 작업을 수행 할 수 있습니다 :

function(data){ 

     var response = $("#area").html(data); <--- the input element pc1 is in the returned data 
     alert((response.find("#pc1").val()) 


     }); 
+0

오 좋은, 덕분에 많은 – jimsmith

관련 문제