LyndonOHRC
Programmer
I have a select list that is populated with JSON Data. I'm trying to pass each record to a function using the onclick event so I can populate several form fields with the data from the selected record. If this is possible how would I go about it?
This is what I've tried but I don't understand enough about the process to get it working.
build the list item(s):
Use the selected item:
Thank you in advance...
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
This is what I've tried but I don't understand enough about the process to get it working.
build the list item(s):
Code:
var users = eval(trim(xmlhttp.responseText));
var str = '<ul>';
for ( var recno in users ) {
str += '<li oonclick="putOwnerData( \'' +users[recno]+ '\')">'+users[recno].DisplayString+'</li>';
}
str +='</ul>';
Code:
function putOwnerData(JasonRecord) {
var users = eval(JasonRecord);
document.getElementById('OwnerLastName').value=users[0].LastName;
document.getElementById('OwnerFirstName').value=users[0].FirstName;
return true;
}
Thank you in advance...
Lyndon
---People Remember about 10% of what you say ---They never forget how you made them feel. Covey