Gossamer Forum
Home : Products : DBMan : Customization :

Dropdown generated on the fly

Quote Reply
Dropdown generated on the fly
Hey ya!

In my search function IŽd like to have a dropdown search of names that is generated by already entered records. All records have the name variable and IŽd like all of them to show up in the dropdown when someone is about to search.

The dropdown part is easy, but I havenŽt figured out how to get the content.

Ofcourse I could put all the names in the "%db_select_fields" in the ".cfg" but it would be so nice to have it created "on the fly" so I wont have to add them when someone adds a new record.

To make it a little harder it would be extremely nice to have them sorted alphabeticly..

Thanks*10^100 for this great piece of code!!
Quote Reply
Re: Dropdown generated on the fly In reply to
I think this is what you are looking for it will build a select from the given field
print &build_select_field_from_db("field",$rec{'field'});
Good luck!

Mike
Quote Reply
Re: Dropdown generated on the fly In reply to
Works smooooth! Thanks a million!

Just wondering about the alphabetic thing.. Is there an easy way to sort the list alphabeticly??
Quote Reply
Re: Dropdown generated on the fly In reply to
They should be sorted. I can't remember whether it sorts lowercase or uppercase first, but there is a "sort" command in the subroutine.


------------------
JPD





Quote Reply
Re: Dropdown generated on the fly In reply to
.. and so it did!! Sorry.. I was bugged by the upper/lower case thing.. Seems like it takes the uppercase first.

Thank you dudes!!!