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
Solved

Newbie:  Coldfusion MX list boxes

Posted on 2010-09-02
6
124 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

CFGRID Custom Functionality Series -  Part 1 Hi Guys, I was once asked how it is possible to to add a hyperlink in the cfgrid and open the window to show the data. Now this is quite simple, I have to use the EXT JS library for this and I achiev…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
The purpose of this video is to demonstrate how to properly insert a Vimeo Video into a WordPress site or Blog. This will be demonstrated using a Windows 8 PC. Go to your WordPress login page. This will look like the following: mywebsite.com/wp…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

839 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