CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> ASP

 Reference text value for listbox w/bound column at runtime

Print topic Send  topic

Author Message
thuslin

Posts: 2
Posted: 05/09/2004, 11:40 AM

At runtime, how can I get the display value of a listbox vs it's stored value? It appears that in ASP, the Listbox Text Column property is only available at design-time.

I have a record form with a listbox of Names that are stored as ID's, but at runtime, on the before insert event of the form, I want to use the displayed text in the listbox to set a value in another field. Basically, if a textbox called Description is empty, I want to put the text value from the Name listbox into the description field. I have no problem capturing the listbox .Value, but I want the displayed text.

Thanks.
View profile  Send private message
peterr


Posts: 5971
Posted: 05/09/2004, 5:01 PM

You cannot capture the displayed text because it is not submitted by the HTML page. The browser submits only one value and it is the key value (or other field specified in the Bound Column). However, you could use CCDLookup function to lookup the text that corresponds to the returned key .Value (in the before insert event.)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
thuslin

Posts: 2
Posted: 05/10/2004, 4:06 AM

I've been working on that, but am having trouble passing the ID from the listbox into the function as part of the where clause in CCDlookup. The only way CCDLookup works in what I've tried, is if I pass the hard-coded ID. How do I pass a variable into the where parameter of CCDLookup using ASP?

This Works: SI_System_Interfaces.Name.Value = CCDLookUp("System_Name", "SI_System_Info", "System_ID = 56", DBSI)

This Doesn't work:
SI_System_Interfaces.Name.Value = CCDLookUp("System_Name", "SI_System_Info", "System_ID = SI_System_Interfaces.System_ID_from", DBSI)

This Doesn't work:
SI_System_Interfaces.Name.Value = CCDLookUp("System_Name", "SI_System_Info", "System_ID = SI_System_Interfaces.System_ID_from.Value", DBSI)

View profile  Send private message
peterr


Posts: 5971
Posted: 05/10/2004, 11:21 AM

Please try:
SI_System_Interfaces.Name.Value = CCDLookUp("System_Name", "SI_System_Info", "System_ID =" & SI_System_Interfaces.System_ID_from.Value, DBSI)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.