Hello,
I'm new to javascript and was hoping someone would be able to help me out.
I'm using the jQuery UI Autocomplete but have ran into a problem.
I would like to know if the user manually enters a name without selecting from the autosuggest list.
If this happens I would then display a bit of text 'user not selected from list'.
How would I go about doing this?
My code:
- $(function() {
- $('#userID').val("");
- $('#userName').val("");
- $('#name').val("");
- $('#email').val("");
- $('#contactNumber').val("");
-
- $("#name").autocomplete({
- source: "users.php",
- minLength: 2,
- select: function(event, ui) {
-
- $('#userID').val(ui.item.userID);
- $('#name').val(ui.item.name);
- $('#userName').val(ui.item.userName);
- $('#email').val(ui.item.email);
- $('#contactNumber').val(ui.item.contactNumber);
-
- }
- });
- });