?
Solved

Newbie:  Coldfusion MX list boxes

Posted on 2010-09-02
6
Medium Priority
?
131 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 22

Accepted Solution

by:
plusone3055 earned 2000 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

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…
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to insert an Iframe into 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 : Open Page or Post…
Suggested Courses

777 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