Solved

Newbie:  Coldfusion MX list boxes

Posted on 2010-09-02
6
123 Views
Last Modified: 2014-10-24
On one of my Coldfusion forms, I have a dynamic list box that gets populated by using cfquery - my question is, how can I allow the user to add a selection to the list box if their choice is not listed?  Thx!
0
Comment
Question by:alphadcb
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 33591115
if their choice is not listed in the listbox and the list is results  from a query....
that choice needs to be added to the database and included in your query.

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 33594074
The listbox with new options is an old general question.
The best choice is to have one Option in the list the allows the user to use a separate Input field for not listed value.
Name that Option: Other
On the server side check if Other selected then use OtherInput value.

0
 
LVL 63

Expert Comment

by:Zvonko
ID: 33594104
Or in other words: same reason that you cannot define Blinking text in style definitions you cannot have Editable select options.
Of course there are enough geeks out there to give you both: blinking editable options; but I assume that was not your question <|;-)
0
 

Expert Comment

by:traport
ID: 33596730
<!--- main form page --->
<!--- note: Certification is a text field --->
<cfquery name="cert" datasource="myAccessDSN">
SELECT Certification
FROM Certification
ORDER BY Certification
</cfquery>
<script>
function showAddPage() {
window.open('addNewCertification.cfm');
}
</script>
<cfform action="somePage.cfm" method="post">
<cfselect query="cert" name="Certification" value="Certification"
multiple="yes" size="5"/>
<a href="javascript:showAddPage();">Add New</a>
</cfform>

<!--- popup page: addNewCertification.cfm --->
<form action="addNewCertification.cfm" method="post">
Certification code: <input type="text" name="Certification">
<input type="submit">
</form>
<cfif IsDefined("form.Certification")>
<cfinsert datasource="#data_source#" tablename="Certification">
<script>
if (window.opener) {
window.opener.location.reload();
window.close();
}
</script>
</cfif>
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

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.
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 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 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…

776 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