This is what the post looks like, I'm "printing" the return data out in the 'area' div, in that data is a hidden form variable input type='hidden' id='pc1' value='wh5', is it possible to get the value of id 'pc1'?, I get 'undefined' at the moment. Do you use live or bind?开发者_如何学C I had a look at those but they appear to be for click events.
$("#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
});
});
You could do this:
function(data){
var response = $("#area").html(data); <--- the input element pc1 is in the returned data
alert((response.find("#pc1").val())
});
精彩评论