Un exemplu simplu.
form.html
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
$(document).ready(function() {
$('select[name=name]').change(function() {
$.ajax({
url: 'customers.xml',
type: 'xml',
success: function(data) {
$('input[name=address]').val($(data).find('address').text());
}
});
});
});
</script>
</head>
<body>
<form name="customerForm">
<select name="name">
<option value="0">Select a name</option>
<option value="1">Nick</option>
</select>
<input type="text" name="address">
</form>
</body>
</html>
customers.xml
<?xml version="1.0" encoding="UTF-8" ?>
<customers>
<customer>
<id>1</id>
<name>Nick</name>
<address>Washington 6</address>
</customer>
</customers>
si xml-ul ti-l poti genera cu php in functie de id-ul clientului.