Solved

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

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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
Objective of This Article In 1990’s, when I was a budding software professional, I had a lot of confusion about which stream or technology, I had to choose to build my career. In those days, I had lot of confusion like whether to choose System so…
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…
The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

828 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