I was able to just dump the json array to all fields doing this:
Code:
<script type="text/javascript">
function loadIntake(){
var client = <?php echo $id ?>;
$.post("loadIntake.php",
{id: client},
function(jdata){
$.each(jdata, function(i, data) {
$('#' + i).val(data);
});
$('input[type=text]').attr("name", function(n, idata){
//$(idata).val(jdata.idata);
//alert (idata);
})
},
"json"
);
}
</script>
However, some of the fields are text fields, some are textfields, some are radio buttons, and checkboxes. As I said the json array has MORE fields than there are fields on the page. So I dont want to deal with unnecessary code runs.
Bookmarks