Populate form help

i am trying to fire a form which after the call to retrieve the data, populate the form with the data. i can see from firebug that the json data is being captured, but cannot seem to be able to populate the form with it. i am using a jquery plugin facybox, that opens the form, but the fields are blank. i have attached my code and would be grateful if someone could tell me where i am going wrong? many thanks

js code

<script type="text/javascript">
function edit(com, grid) {
if (com == 'Edit') {
                alert('Please select just one row');
            var items = $('.trSelected');
            var itemlist ='';
                itemlist+= items[i].id.substr(3);
			   type: "POST",
			   dataType: "json",
			   url: "tempcontact.php",
			   data: "items="+itemlist,
			   success: function(data){
			   	document.getElementById('id').value = data.id;
            document.getElementById('email').value = data.email;
            /*and so on then you can call facybox*/
           jQuery.facybox({ div: "#editform"});
        } else{
            alert('Please select a row to edit.');


<div id="editform" style="display:none;">
  <form action="conedit.php" method="post" class="webform">  
<legend><span>Update Contact</span></legend>
<br /> <div id="dataText">Please delete the fields if there is no data 'No data to display'.</div>
  <label for="id">ID:</label>  
<input id="id" name="id" class="text" type="text" value="" />
<label for="name">Full Name:</label>  
<input id="name" name="name" class="text" type="text" value="" />  
<label for="email">Email address:</label>  
<input id="email" name="email" class="text" type="text" value="" />  
<label for="phone">Telephone:</label>  
<input id="phone" name="phone" class="text" type="text" value="" />  
<label for="mobile">Mobile:</label>  
<input id="mobile" name="mobile" class="text" type="text" value="" />  
<label for="fax">Fax:</label>  
<input id="fax" name="fax" class="text" type="text" value="" />  
<label for="notes">Notes:</label>  
<textarea name="notes" cols="25" rows="3"></textarea>  

<input class="submit" type="submit"  name="submit" value="Update" />

can no-one offer any advice on this? thanks