[Mapserver-users] Re: On-the-fly generated picklists in query-forms

pkishor_98 pkishor at geoanalytics.com
Sat Oct 25 13:32:39 PDT 2003


--- In mapserver-users at yahoogroups.com, "Roman Meier" <mapserver at g...> wrote:
> Hi list
> 
> A bit off topic maybe...

really ;-)

> 
> I would like to implement an unconventional picklist in my queries. Using a
> form, the user should have the possibility to select the searchstring out of
> a picklist. The picklist is generated on-the-fly(!). The function searches
> the table (postgis, mysql or dbf) for all items, that have been entered
> before...
> 
> - Did somebody do something like this before?
> - How can I implement this using php/mapscript and postgis?
> - Any ideas?
> 

given that you are asking this, I am going to assume there is something specific here 
that is out of the ordinary... I mean, this is one of the commonest devices one sees on 
the web, so why...?

Anyway -- assuming you want to populate a form using values from a table --

1. query the table for values and text, and create a form

select values, text from table where whatever

<option value=$value>$text</option>

and then use the $value to query the database for the results.

If you want something that focuses on the items as you type characters,  you can fill a 
javascript array with the $text values, and then use onkeypress to trap the characters 
as they are typed, search through the array, calculate the selectedindex and focus on 
the fly. Is that what you asking?

If it is something else you are asking, my apologies -- I didn't understand the 
question.





More information about the MapServer-users mailing list