1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
if(this.value==5)
{
function citySeek(evt)
{
method: 'post',
contentType: 'application/x-www-form-urlencoded',
charset: 'UTF-8',
parameters: 'zip=01000',
onSuccess: function(transport)
{
var root = transport.responseXML.firstChild;
if(root.childNodes.length -1 > 1)
{
var input = document.createElement('select');
input.className='inputBox';
for(var i = 0 ; i <= root.childNodes.length - 1 ; i++)
{
var city = root.childNodes[i].firstChild.nodeValue;
var elt = document.createElement('option');
var label = document.createTextNode(city);
elt.value=city;
elt.appendChild(label);
input.appendChild(elt);
}
}
else if(root.childNodes.length -1 == 1)
{
var input = document.createElement('input');
input.type='text';
input.readonly='readonly';
}
else
{
alert('Veuillez saisir un code postal valide');
}
$('puter').appendChild(input);
$('puter').size="120";
}
});
}
} |
Partager