Solved

ColdFusion <cfselect> and populating the onChange() event with the user selected value.

Posted on 2007-03-27
1
1,631 Views
Last Modified: 2013-12-20
This question is written in regards to the coldfusion tag <cfselect>.

In my <cfselect> tag, I have a recordset successfully populating a list box.  I would like the value attribute to be passed to a JavaScript onChange() event inside of the <cfselect> tag, and it seems like the <cfselect> does not want to give up the value to JavaScript inside it's execution.

I have researched using a <cfloop> or an <cfarray> to do this, but ideally I would like to set the value in the onchange() event of the <cfselect> tag.  That way, I can work with a single user selection once they have made it during the submit form action.

The code examples are a straight-forward <cfselect> for a query so there is really nothing special to note there.  

Thanks in advance for your suggestions.  


0
Comment
Question by:CyprexxDev
1 Comment
 
LVL 39

Accepted Solution

by:
gdemaria earned 250 total points
Comment Utility

  this will pass the value selected to "yourFunction()"...

 <select onChange="yourFunction(this.options[selectedIndex].value);">

0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
The purpose of this video is to demonstrate how to automatically show related posts at the bottom of a blog post in WordPress. This will be demonstrated using a Windows 8 PC. Plugin “Yet Another Related Posts Plugin” will be used. Go to your…
The purpose of this video is to demonstrate how to make a WordPress Site faster and smaller in size by cleaning up the database. This will be demonstrated using a Windows 8 PC. Plugin WP Optimize will be used. Go to your WordPress login page. T…

771 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

14 Experts available now in Live!

Get 1:1 Help Now