Displaying user selection on same page - Part II

Dear Experts,

I have asked this question previously and had got an answer, but now I need to fullfill another requirement, that is the user will also be able to select the appended item and delete it from the list.

Can anyone help?

As Posted last time :
I have a form with a drop down menu box populated from a query from the database with a add button. When the user selects the item from the drop down box and clicks add, I want to display the selected item on the same page (showing the user what he/she has selected), after which the user can make other selections using the same drop down menu box and add the selection which will be appended below what he/she has added on earlier.

How can I do this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

There is a custom tag called CF_TwoSelectsCombo, which does something very similar to what you're looking to do.

You can get it at http://www.geocities.com/thanny/ or the Macromedia Developer's exchange.

What you're looking to do (without refreshing the page, each time you click add) will require javascript.  If you need a slightly different control, you might be able to use this as a starting point.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
I still had the code from your previous Q. Here's an update that adds the remove functionality.

<cfparam name="form.valueList" default="">
<cfparam name="myList" default="">
<cfif isdefined("form.things")>
     <cfset myList = form.valueList>
     <cfif len(form.removeList)>
          <cfset myList = listdeleteat(form.valueList,form.removeList)>
          <cfset myList = listappend(myList,form.things)>

<script language="JavaScript">
function removeItem(itemNumber){
     document.frmAdd.removeList.value = itemNumber;

<form name="frmAdd" action="add.cfm" method="post">
     <select name="things">
          <option value="this">this</option>
          <option value="that">that</option>
          <option value="the other">the other</option>
     <input type="submit" value="Add Item">
     <input type="hidden" name="valueList" value="<cfoutput>#myList#</cfoutput>">
     <input type="hidden" name="removeList" value="">
<table border="1">
     <cfloop from="1" to="#ListLen(myList)#" index="item">
          <td><a href="javascript:removeItem(#item#);">remove this item</a></td>

TriggerFishAuthor Commented:
I will close this question, both JimV and jyokum has given me good answers.

JimV's answer is close to what I am looking for, but jyokum has given me solutions which I can apply to other parts of my project.

Points wise, 25 to jyokum and 5 to JimV....any objections?

Thanks for all your help
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

You have requested a split that cannot be performed.  Each expert must receive a minimum of 20 points in a technical area.  Let me know how you would like to proceed.

Community Support Moderator @Experts Exchange
TriggerFishAuthor Commented:
OK, I have decided to give both experts 20 pts each.
Points reduced to 20.

You may now accept one expert's comment as the answer.

Next create a "points for expert2 re 20567868"(replace expert2 with the actual expert's name) question in this same Topic area:
Assign 20 points to it.
Grab the URL of the new question (make sure it has the question number in it) and return here to tell the other expert where to get their points at.

If you need further help or the "points for" question isn't posted within a couple of days, somebody drop a note to me here.  Thanks.

Community Support Moderator @Experts Exchange
TriggerFish, please accept a comment as the solution
I have performed the split.  Thanks for dropping a note here to alert me.

jyokum,points for you at:

Community Support Moderator @Experts Exchange
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.