Hi All,
I have implemented a Autocomplete text item using jquery.Every thing looks fine, but when we clear the country the corresponding state should be cleared.
Here is the code, can any body hep me out where and how to clear the values.
--
<script type="text/javascript">
$( function() {
$("#P16_ENG_CTRY").autocomplete({
source : function( request , response) {
data = getCountry(request.term);
response( data );
} ,
focus : function(event , ui){
event.preventDefault();
}
});
});
function getCountry(key)
{
document.getElementById('P16_ENG_CTRY')=='';
var ajaxRequest = new htmldb_Get( null , '&APP_ID.' , 'APPLICATION_PROCESS=GET_COUNTRY' , 0);
ajaxRequest.add( 'G_MX01' , key);
ajaxResult = ajaxRequest.get();
return ((ajaxResult.length>0)? ajaxResult.split( '~' ):null);
}
$( function() {
$("#P16_ENG_STATE").autocomplete({
source : function( request , response) {
data = getStateJ(request.term);
response( data );
} ,
focus : function(event , ui){
event.preventDefault();
}
});
});
function getStateJ(key)
{
document.getElementById('P16_ENG_STATE')=='';
var ajaxRequest = new htmldb_Get( null , '&APP_ID.' , 'APPLICATION_PROCESS=GET_JSTATE' , 0);
ajaxRequest.add('G_MX01',document.getElementById('P16_ENG_CTRY').value);
ajaxRequest.add( 'G_MX03' , key);
ajaxResult = ajaxRequest.get();
return ((ajaxResult.length>0)? ajaxResult.split( '~' ):null);
}
$( function() {
$("#P16_ENG_CITY").autocomplete({
source : function( request , response) {
data = getCityJ(request.term);
response( data );
} ,
focus : function(event , ui){
event.preventDefault();
}
});
});
Thanks,
Anoo..