Ajax autocomplete based on usercode

You could fill in the form as shown below:

inputs = document.getElementsByTagName('input');
for (index = 0; index < inputs.length; ++index) {
    // assign inputs[index] element values from the response.
}

This is pure JavaScript, unless I miss something.