How can I do autocomplete in joomla module - Joomla! Forum - community, help and support
hi,
sorry english,
i want autocomplete funkction in 1 of input elements in joomla module.
i this:
php source:
jquery source:
html source:
url:http://www.nachbarhilft.de/
i know problem url: 'mod_adds_display.php'. can change convey keyword php variable , query without refreshing page?
i used snippets of code, because rest irrelevant problem.
greetings
sorry english,
i want autocomplete funkction in 1 of input elements in joomla module.
i this:
php source:
code: select all
$keyword = jrequest::getvar('keyword');
echo $keyword;
//query db find matches
$query_auto = "select kod_pocztowy juxhv_kody kod_pocztowy '%".$keyword."%' limit 0, 10;";
$baza_danych->setquery($query_auto);
$baza_danych->query();
jquery source:
code: select all
function autocomplet()
{
var min_length = 0; // min caracters display autocomplete
var keyword = jquery('#plz').val();
//alert(keyword);
if (keyword.length >= min_length) {
jquery.ajax({
url: 'mod_adds_display.php', //how can change this,
type: 'post',
data: {keyword:keyword}, //bylo keyword
success:function(data){
alert(data);
jquery('#country_list_id').show(); //show();
jquery('#country_list_id').html(data);
}
});
} else {
jquery('#country_list_id').hide();
}
}
// set_item : function executed when select item
function set_item(item) {
// change input value
jquery('#plz').val(item);
// hide proposition list
jquery('#country_list_id').hide();
}
html source:
code: select all
<input id="plz" type="text" name="plz" value="plz" onclick="clear_value4();" onkeyup="autocomplet()"/>
url:http://www.nachbarhilft.de/
i know problem url: 'mod_adds_display.php'. can change convey keyword php variable , query without refreshing page?
i used snippets of code, because rest irrelevant problem.
greetings
autocomplete 1 element form ( text, button, .....) or number?
Comments
Post a Comment