How to implement an autocomplete text input field
-
Hello,
I will like to implement an autocomplete text input field in my website but It doesn’t work.
I need a autocompletion for the city name.I made the following staffs:
1°/ In my functions.php file:
wp_enqueue_script( ‘suggest’ );
2°/ In my js folder, I create this js file:
<script>
$(‘#suggest’).suggest(“town_list.txt”,{
onSelect: function() {
alert(“You selected: ” + this.value );
}
});
</script>3°/ In my php page:
<input type=”text” id=”suggest” name=”keyword” />
BUT I DOESN’T RUN!!! I don’t know why? Does someone could help me please.
Best regards,
Gwen
- The topic ‘How to implement an autocomplete text input field’ is closed to new replies.