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

dynamic drop down based on user selection

Participant ,
Sep 08, 2006 Sep 08, 2006

Copy link to clipboard

Copied

hi all, ok, I have a table which contains use data, a name, and a userID. for the example lets say "Simon Bullen" and my userID is "999".
on a form I have, there is a dropdown box, which is dynamic from this table, and allows me to select Simon Bullen, however, I have a hidden field on the form, which when the user selects "simon bullen" the hidden field populates with the appropiate U number from the same table.... no i thought this would do it:

<cfquery name="userNumber" datasource="userList">
SELECT userNumber FROM dbo.Users WHERE Name =
<cfqueryparam value="#form.Name#">
</cfquery>

and then my dynamic form field (hidden) would reference to this query....

but it doens't work, could somebody please enlighten me? I'm hoping its something silly

Thanks in advance
TOPICS
Server side applications

Views

318
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
Participant ,
Sep 08, 2006 Sep 08, 2006

Copy link to clipboard

Copied

Sorry forgot to say, am using DM8, SQL and CF7

thanks

Votes

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 ,
Sep 10, 2006 Sep 10, 2006

Copy link to clipboard

Copied

Is there a particular reason why you want to set the dropdown value to
another field rather than referencing it directly.

--
Paul Whitham
Certified Dreamweaver MX2004 Professional
Adobe Community Expert - Dreamweaver

Valleybiz Internet Design
www.valleybiz.net

"Simonbullen" <webforumsuser@macromedia.com> wrote in message
news:edrrik$feu$1@forums.macromedia.com...
> hi all, ok, I have a table which contains use data, a name, and a userID.
> for
> the example lets say "Simon Bullen" and my userID is "999".
> on a form I have, there is a dropdown box, which is dynamic from this
> table,
> and allows me to select Simon Bullen, however, I have a hidden field on
> the
> form, which when the user selects "simon bullen" the hidden field
> populates
> with the appropiate U number from the same table.... no i thought this
> would
> do it:
>
> <cfquery name="userNumber" datasource="userList">
> SELECT userNumber FROM dbo.Users WHERE Name =
> <cfqueryparam value="#form.Name#">
> </cfquery>
>
> and then my dynamic form field (hidden) would reference to this query....
>
> but it doens't work, could somebody please enlighten me? I'm hoping its
> something silly
>
> Thanks in advance
>


Votes

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
Participant ,
Sep 11, 2006 Sep 11, 2006

Copy link to clipboard

Copied

LATEST
Thanks for the reply, see what i'm trying to do is have the user insert thier 'common name' and thier 'user number' as I need both in the database. But i didn't want them to have to select both, so I thought there might be a relativly easy way to automatically select thier user number when they select thier name....

do I make sense?

Votes

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