Solved

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

Posted on 2007-03-27
1
1,685 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The purpose of this video is to demonstrate how to reset a WordPress password if you are locked out and cannot reset the password. A typical use would be if you cannot access the email to which WordPress would send the password recovery email to…
The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…

735 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