Options work like select boxes on web pages?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
jesse
Posts: 205
Joined: Thu Nov 11, 2010 6:32 pm

Options work like select boxes on web pages?

Post by jesse » Wed Nov 17, 2010 8:25 pm

The reason I ask is I need to be able to have a select box like on a webpage where
it has a Username title and userid value and a coded value like this:

Code: Select all

<option value="UserID">Username</option>
The reason I need to have a value and a display title
is because I need to do an insert based on the UserID into a database table.

The code I am using now to populate the option list is this:

Code: Select all

put revDataFromQuery(tab ,cr ,dbID ,tSQL) into tList
revCLoseDatabase(dbID)

if tList contains "revdberr" then return ""
set the rowDelimiter to cr
# the New... function below isn't implemented yet
put tList & cr & "-" into tList
set the text of button "Event" to tList
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Re: Options work like select boxes on web pages?

Post by Janschenkel » Fri Nov 19, 2010 2:31 pm

You can use 'tags' for this. The menu specification is a list of lines that look like this:

Code: Select all

[ <modifiers> ] <label> [ '|' <tag> ] 
SZo an optional set of modifiers, followed by the label of the menu item, optionally followed by a tag. The label is displayed and the tag is used as the parameter for the menupick message instead of the label.
You can use this for multi-lingual applications as well as your use case of hiding ID's.

HTH,

Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

jesse
Posts: 205
Joined: Thu Nov 11, 2010 6:32 pm

Re: Options work like select boxes on web pages?

Post by jesse » Thu Jun 02, 2011 2:39 am

Thanks Jan. I'll read up on tags sounds like a good option for me.
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392

Post Reply