var dummyData = new Object;   
dummyData[0] = new Object;   
dummyData[0]['title'] = "";   
dummyData[0]['addr1'] = "";   
dummyData[0]['addr2'] = "";   
dummyData[0]['town'] = "";   
dummyData[0]['state'] = "";   
dummyData[0]['postcode'] = "";   
dummyData[0]['telephone'] = "";   
dummyData[0]['fax'] = "";   
dummyData[0]['hidden'] = "N";   
   
function fillRetailer(id)   
{   
	if(id>0) {   
		sendRequest("/heat/web/includes/retailerupload_xmlrpc.php", ("id="+id), callback);   
	}   
	else {   
		tempObj = dummyData[0];   
		fillForm(tempObj);   
	}   
}   
function callback(request) {   
	var tempObj;   
	eval("tempObj = "+request.responseText);	   
   
	if(!tempObj || tempObj=="") {   
		alert("No matching data for the selected retailer.");   
		return false;		   
	}	   
	   
	fillForm(tempObj);   
}   
function fillForm(obj) {   
	for (i in obj) {   
		if(document.getElementById(i))   
			document.getElementById(i).value = obj[i];   
	}   
}   

» Read More