<script type="text/javascript" language="javascript">
var http_request = false;
function makeRequest(zip) {
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
http_request.overrideMimeType('text/xml');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Abandon :( Impossible de créer une instance XMLHTTP');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('GET', 'conf/zip.php?zip='+zip, true);
http_request.send(null);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
document.getElementById('div_out').innerHTML=http_request.responseText;
} else {
alert('Un problème est survenu avec la requête.');
}
}
}
</script>
<script>
function getcity(vill)
{
document.getElementById("city").value=vill;
document.getElementById("city").focus;
}
</script>
<form method="post" action="?action=add">
<table>
<tr>
<td>Nom Société</td>
<td>:</td>
<td><input type="Text" name="company"></td>
</tr>
<tr>
<td>Nom Contact</td>
<td>:</td>
<td><input type="Text" name="contact"></td>
</tr>
<tr>
<td valign="top">Adresse du siège</td>
<td valign="top">:</td>
<td><textarea name="billing"></textarea></td>
</tr>
<tr>
<td>Code Postal</td>
<td>:</td>
<td><input type="Text" name="zip" size="3" maxlength="4" onblur="makeRequest(this.value);"></td>
</tr>
<tr>
<td valign="top">Commune</td>
<td valign="top">:</td>
<td><div id="div_out"></div></td>
</tr>
<tr>
<td>Téléphone</td>
<td>:</td>
<td><input type="Text" name="phone"></td>
</tr>
<tr>
<td>GSM</td>
<td>:</td>
<td><input type="Text" name="mobile"></td>
</tr>
<tr>
<td>Fax</td>
<td>:</td>
<td><input type="Text" name="fax"></td>
</tr>
<tr>
<td>Mail</td>
<td>:</td>
<td><input type="Text" name="mail"></td>
</tr>
<tr>
<td align="right"></td>
<td></td>
<td align="left"><input type="submit" value="Ajouter >"></td>
</tr>
</table>
VBoici le code généré de ma page 
</form>