I run an ajax request and return a json array.
There is more in the json array than there is fields on the page. I want to cycle through text fields and find their NAME and match that to the json array and fill in the value.

The names of the fields and the names in the json array are the same.

Code:
<script type="text/javascript">
function loadIntake(){
	var client = <?php echo $id ?>;
	
	$.post("loadIntake.php", 
		{id: client},
		function(jdata){
				$('input[type=text]').attr("name", function(n, idata){
					//$(idata).val(jdata.idata);
					alert (jdata.idata);
				})
		},
		"json"
	);  

}
</script>
What am I doing wrong here?