Passing values through cfm to CFC's

Posted on 2005-04-22
Last Modified: 2013-12-24
I have a page with a combobox, containing the names of different railroads.  I want to take the value the user chooses and pass it into my cfm page as a component.  Each individual railroad is an extension of the base railroad component.  
The type of information I want to display is different, depending on the railroad selected.

<cfset railObj = createObject("component","NAME OF VALUE SELECTED FROM COMBOBOX") >

How do I get the value of the selected item imported into the cfset statement
Question by:RogersGirl
    LVL 35

    Accepted Solution

    LVL 22

    Expert Comment

    hi rogersgirl.
    I think we may need more inforamtion about what you are trying to achive.

    if you are looking for the value of the select item in the cfset... what you can do is that...


    for that you will have to return your value in your function like

        <cffunction name="fgetmonth" returntype="query">

            <cfquery name="getmonth" datasource="#dsn#">
            your query
            <cfreturn qget_getmonth_month>

    Author Comment

    I have a "railroad" component which extends into "bayline", "P&L", and "FEC".  These values are all in a combobox.  When the user selects a particular value, I want to have that value passed into my cfset as the component name I want to pull information from.
    LVL 22

    Expert Comment

    I am not clear that
    if the answer from mrichmon fixed your problem, (very good) or you still need more help after that?

    Author Comment

    mrichmon's answer did fix my problem.  I substituted his code into my cfset statement as the name of my component.
    LVL 22

    Expert Comment

    good to hear that :) good day !

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
    Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Hi everyone! This is Experts Exchange customer support.  This quick video will show you how to change your primary email address.  If you have any questions, then please Write a Comment below!

    794 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now