This is a simple example. Hope it helps. Just let me say that it would be easier with server side language.
<script type="text/javascript">
//this array works as a database
//the index on this array
//should match the select option value
//i.e. dbarray[1] data should be about person with ID "a001"
dbarray=new Array();
dbarray[0]='~~';
dbarray[1]='john~dotdot@whosethere.net~';
dbarray[2]='jane~nomail~';
dbarray[3]='jean~email@mail.com~'
//'~' is used to delimiter each data-field
//you should one '~' per line for each field to fill
//this array is for the fields to fill
//its values correspond to the id of the fields to fill
nfields=new Array();
nfields[1]='name';
nfields[2]='mail';
function populate(x)
{
st=dbarray[x];
for(i=1;i<=2;i++) //number "2" is for the 2 empty fields
{
prtst=st.substr(0,st.search('~'));
document.getElementById(nfields[i]).value=prtst;
st=st.substr(st.search('~')+1);
}
}
</script>
<form name="form" action="" method="get">
ID <select name="id" onchange="populate(this.value);">
<option value="0"></option>
<option value="1">a001</option>
<option value="2">d210</option>
<option value="3">7e3s</option>
</select>
<br />
Name <input name="name" id="name" />
<br />
eMail <input name="mail" id="mail" />
</form>