Sending results to a ColdFusion Variable via OnChange event

Posted on 2005-04-20
Last Modified: 2013-12-16
I am fairly new to CF and I am trying to assign the selected item from a listbox to a CF Variable for further processing. Here is the trimmed down code:

<!--- Defualt value --->
<cfset Variables.Dept = "ALL">
<!--- Not sure what to put under the "onChange" event. I need something like Variables.Dept =         this.value --->
<select name="lstDept"  onChange="????????????????">

Any suggestions?

Thanks In Advance
Question by:htmoore
    LVL 53

    Accepted Solution

    Cf functions run on the server before the page is sent.  If you want to bring a client side value back into CF, you have to submit it on a form, the client ans server operate independently of each other


    LVL 3

    Expert Comment

    Sounds like your trying to do something like dependent drop down boxes?

    I have a page where you select a group and from that choice, the list of group members is presented in another drop down


    function updateSecEng()
    ifrHidden.location = 'updateProjectPage.cfm?priEng=' + document.projEntry.pri_eng.value;

    in the form:
    <select name="pri_eng"  style="width: 225px;" onchange="updateSecEng();">
    LVL 24

    Expert Comment

    there is a cf ta on EE

    and if you are looking for related selects in CF try this

    if you are not looking for related selects we will need more information in order to help you out


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    The purpose of this video is to demonstrate how to integrate Mailchimp with Facebook. This will be demonstrated using a Windows 8 PC. Mailchimp and Facebook will be used. Log into your Mailchimp account. : Click on your name. Go to Account Setti…
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    760 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

    8 Experts available now in Live!

    Get 1:1 Help Now