Solved

Newbie:  Coldfusion MX list boxes

Posted on 2010-09-02
6
119 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
<!--- 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today, I was working on some optimization and spam-stopping techniques when I encountered Ben Nadel's post to reduce spam feature using Math (http://www.bennadel.com/blog/197-How-I-Stop-Spammers-On-My-ColdFusion-Blog.htm). While this method is not o…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
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 integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

743 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

15 Experts available now in Live!

Get 1:1 Help Now