View Single Post
Old 03-05-2006, 04:59 PM   #4 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,503
sde is on a distinguished road
well if you have it in a javascript array format, then it is simple.

You are correct in using responseText, and now you just use the eval function to assign it to a javascript array.

in my code example, you would use responseText as the argument passed to processResponse(), .. then in processResponse() you would set the javascript array like this:
HTML Code:
function processResponse(responseText) {
  var myarray = eval(responseText);
  
  document.forms.formname.storename.value=myarray['storename'];
  document.forms.formname.contactname.value=myarray['contactname'];
  document.forms.formname.address.value=myarray['address'];
  document.forms.formname.city.value=myarray['city'];
  document.forms.formname.state.value=myarray['state'];
  document.forms.formname.zipcode.value=myarray['zipcode'];
  document.forms.formname.phone.value=myarray['phone'];
}
sde is offline   Reply With Quote