Solved

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

Posted on 2007-03-27
1
1,644 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
ID: 18803446

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

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

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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.
When setting up new project requests for our site, one of the most powerful tools our team has available to use is Axure (http://www.axure.com/). It’s a tool for creating software and web prototypes that can function and interact as if it were the a…
The purpose of this video is to demonstrate how to connect a WordPress website to Google Analytics. This will be demonstrated using a Windows 8 PC Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php :…
The purpose of this video is to demonstrate how to Import and export files in WordPress. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp-login.php : Click on Too…

930 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

17 Experts available now in Live!

Get 1:1 Help Now