ajax presentation question/recommendations?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Fellow PHP'ers;

I've been brain dead for a couple of days trying to come up with a
reasonable solution.  Perhaps your brains work better...

In my php app, I have an input field to gather an identifying number
such as an asset number.  Its a simple single field.  If the user
knows the asset number, no big deal, he just enters it and clicks
away.  Works like a charm.

Now, for those cases where the asset number is not known, I want to
provide a selection list to choose from.  What I did was add a seach
icon to the right of the input field as an <img statement with an
onclick event.  When clicked it calls an ajax function which queries
the host for a list of assets to choose from.

So far, pretty standard, right?

Now the question:  I am planning to generate a dynamic select list and
with the item selected populate the input field.  Question is:  where
should I display the select list?

Sounds like a stupid question but can I just display it adjacent to
the help icon I added?  I should have to pre-define a place-holder
such as a hidden select structure.  Will this effect the form?  And I
am assuming that I will need to use javascript to accept the selected
entry and place it into the input field then re-hide the select list.

Am I thinking on the right track here?

I apologize for the confusion and vagaries but that's how my brain has

Any ideas and suggestions GREATLY appreciated.


Re: ajax presentation question/recommendations?

Quoted text here. Click to load it

Well first thing to observe is that this has nothing to do with PHP
and even the AJAX question isn=92t relevant.

One big questions springs to my mind:
You have stated that for a user who doesn=92t know an asset number you
will give them a list of assets to choose from. However, you have
already stated that the user doesn=92t know the asset number. So
presenting them with a list to pick one from is no help at all. You
might just as well pick one at random and use that!

Another question is on your terminology. You say that you will give
them asearch=94 button. But search implies having something to look
for. You have not stated that they have anything to search for. I
would thus term this as abrowse=94 function. Of course, regardless of
whether they browse or search, the fact that they don=92t know what
asset number to choose still makes the whole thing pointless.

Re: ajax presentation question/recommendations?

El 05/07/2010 14:39, bobmct escribió/wrote:
Quoted text here. Click to load it

You are describing the classical auto-completion widget. In the
implementations I've used nothing gets changed in the form itself. The
user is offered a floating <div> with a <ul> and keyboard navigation
enabled and the chosen option gets copied to the <input>. See here for
some demos:

http://jquery.bassistance.de/autocomplete/demo /
http://www.codenothing.com/demos/2009/auto-complete/demo /

-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com

Site Timeline