?
Solved

Displaying user selection on same page - Part II

Posted on 2003-03-30
8
Medium Priority
?
145 Views
Last Modified: 2013-12-24
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?
0
Comment
Question by:TriggerFish
[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
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 5

Accepted Solution

by:
JimV_ATL earned 80 total points
ID: 8233888
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.

0
 
LVL 12

Expert Comment

by:jyokum
ID: 8234003
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)>
     <cfelse>
          <cfset myList = listappend(myList,form.things)>
     </cfif>
</cfif>

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

<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>
     </select>
     <input type="submit" value="Add Item">
     <input type="hidden" name="valueList" value="<cfoutput>#myList#</cfoutput>">
     <input type="hidden" name="removeList" value="">
<table border="1">
     <cfoutput>
     <cfloop from="1" to="#ListLen(myList)#" index="item">
     <tr>
          <td>#listgetat(myList,item)#</td>
          <td><a href="javascript:removeItem(#item#);">remove this item</a></td>
     </tr>
     </cfloop>
     </cfoutput>
</table>
</form>

0
 

Author Comment

by:TriggerFish
ID: 8260172
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
0
How Blockchain Is Impacting Every Industry

Blockchain expert Alex Tapscott talks to Acronis VP Frank Jablonski about this revolutionary technology and how it's making inroads into other industries and facets of everyday life.

 

Expert Comment

by:SpideyMod
ID: 8358849
TriggerFish,
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.

SpideyMod
Community Support Moderator @Experts Exchange
0
 

Author Comment

by:TriggerFish
ID: 8361711
OK, I have decided to give both experts 20 pts each.
0
 

Expert Comment

by:SpideyMod
ID: 8362518
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:
http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/
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.

SpideyMod
Community Support Moderator @Experts Exchange
0
 
LVL 12

Expert Comment

by:jyokum
ID: 8425401
TriggerFish, please accept a comment as the solution
0
 

Expert Comment

by:SpideyMod
ID: 8427630
I have performed the split.  Thanks for dropping a note here to alert me.

jyokum,points for you at:
http://www.experts-exchange.com/Web/WebDevSoftware/ColdFusion/Q_20601209.html

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

771 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