• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Selected Value for CFSelect and other options too

Contributor ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

I have an update form with an "Office" field. For a record, I query the db and get all the data for the record including the current office. However, since this is an update/edit form, I want the current office to display as selected, but want to also include all the other offices. How Do I do this in a cfselect? I can figure out how to either display the current office, and no other offices, or I can display all the offices, but not have the current office selected. Argh.
TOPICS
Advanced techniques

Views

329

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

you have a query that pulls data for current record - let's call it
REC_QUERY, and let's say the field with the office data is called... OFFICE
have another query that pulls all offices - let's call it OFFICE_QUERY
set the QUERY attrib of your cfselect to OFFICE_QUERY
set appropriate DISPLAY and VALUE attributes
set the SELECTED attribute of your cfselect to #REC_QUERY.OFFICE#

hth


---
Azadi Saryev
Sabai-dee.com
http://www.sabai-dee.com

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Feb 12, 2008 Feb 12, 2008

Copy link to clipboard

Copied

LATEST
Thank you.. Something so simple, just totatlly confused me! Thank you again, I just tried the code and it works great.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation