I have been trying to use one of the many ajax autosuggest code snippets available on the web to help me with a table server scheduling form.

My scheduler can find the people by their last name, and I can auto-suggest that. The database would like to record the server's server_id value, which is a standard auto_increment int in MySQL.

I have been stumbling on the issue of displaying an array and selecting one element in that array but saving in my form field value the server_id associated with the server's name.

Any help would be appreciated.

I'm confused, are you talking about a 'table waiting' scenario or is 'server' referring to 'server' in the computing sense?

In this case, server is a person helping (like a table server). I want the person selecting servers from a long list to be able to use the person's name, but I would like the form to store (in a hidden field) the numeric id of the server. In all the auto-suggest examples I have found on the web, they all assume the lookup value is the value you want to save, which is not so in my case. Look up his name, save his number.

Are you over-engineering the problem? Do you have that many servers that you couldn't use a simple dropdown (surname first for example)? Do you really need ajax for this?

If you just went down the simple route, I think you'd find that form submission would then be a dawdle.

I have 183 servers. 10 events each weekend. 5 servers per event. I think it would be good to filter based on the last name.

This article has been dead for over six months. Start a new discussion instead.