hi,
i made myself a simple form with 2 text boxes. 1 call city, 1 call county.
upon lose focus on the city text box, i want javascript auto fill the county text box with the correct value.
however, i kept getting “[object XMLHttpRequest]” as the value instead of the actual county value, i must missing a couple minor steps here please help.
[code]
<script src=”prototype.js” language=”JavaScript” type=”text/javascript”></script>
<input type=”text” id=”txtCity” onblur=”checkCounty();” />
<input type=”text” id=”txtCounty” />
my code for using prototype is like this:
[code]
function checkCounty(){
var url = ‘ajaxCounty.aspx’;
var param = ‘city=’ + $F(‘txtCity’);
var ajax = new Ajax.Request(
url,
{method: ‘get’,
parameters: param,
onSuccess: function(m_county){
var node = $(‘txtCounty’);
node.value = m_county;
}
});
}//end checkCounty
the ajaxCounty.aspx is very simple…just grab the value through http get and do the typical sql query, then spit the value through response.write….
i think i not using new Ajax.Request correctly, would someone please help point out where i did wrong?
thank you.