ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Iron Speed
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old October 20th, 2004, 02:16 AM
wballz wballz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 11 wballz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 45 m 50 sec
Reputation Power: 0
Manipulatin a Multiselectable list (adding, deleting, maintaining)

Hey guys i am having some real trouble trying to manipulate a multiselectable list.

The layout is hard to describe, but basically there is a table contining many values (populated by a cfquery's output) some values have children, so if you click next to a parent value (on an img link) you will be taken to a similar page where only the child values are shown, while if you click on any value it will be added to a multiselectable list that is shown at the bottom of the page.

Managing this list is my problem. At the moment when you click on a value it will recall the same page with a URL variable addvalue=#value# this value is added to a string that is used to populate the multiselectable list (you still following?...) so the longer the string the more items contained in the list. My problem comes with removing from the multi-selectable list.

I want a user to click on an item in the list then click on a remove button and the item is then removed from the list. I have tried this in 2 ways and one is very close to working:
1. Using javascript - the onclick event on the remove button runs the function removefromlist(listobject) and basically it removes the selected value in listobject. This effectively removes the value from the multiselectable list, but i can't then alter the string that holds the contents of the list so when i refresh the page (or click on a parent->child link) the list is populated with the string and the removed item still appears.

2. Recalling The Page - When the remove button is clicked the page is recalled with a deleteID value in the querystring (e.g. page.cfm?deleteID=#deletethis#) My problem here is getting the selected value from the multi selectable list. I know in javascript you can get the value by using the properties of the object (e.g. mulitlist.SelectedIndex.value or multilist.options[d].value ) but i can't reference these attributes in cold fusion so i can't find out what value has been selected by the user. I would like to be able to call a javascript function called getSelected(multibox) but i can't find a way to pass a value back from the javascript to coldfusion (unless it is a form object like a textbox, then textbox.value = mulitlist.SelectedIndex.value would work)

If anyone understands my ramblings i hope you can please give me some advice

I assume that calling a javascript function in normal coldfusion code (not in an event) will never work??

I have tried things such as:
<cfset var = getSelect(listbox) >
<a onFocus="#var# = getSelect(listbox)">change value</a>
and within the javascript calls such as:
window.var = value;

Reply With Quote
  #2  
Old October 20th, 2004, 08:28 AM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Nope, I have no idea what you are asking for. If you have a list of items and when the user picks one you want to go to a page that has all the children of that item, why not just create a separate page that does that and pass in the parent value, and that page will display the children?
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian.
How to Post a Question in the Forums

Reply With Quote
  #3  
Old October 20th, 2004, 07:47 PM
wballz wballz is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 11 wballz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 45 m 50 sec
Reputation Power: 0
Quote:
Originally Posted by kiteless
Nope, I have no idea what you are asking for. If you have a list of items and when the user picks one you want to go to a page that has all the children of that item, why not just create a separate page that does that and pass in the parent value, and that page will display the children?




ahh yeah i thought this may be a little hard to follow.

Basically i want to know if you can find what is the selected item in a multiselectable list and then put it into a variable without actually submitting the form.

Reply With Quote
  #4  
Old October 20th, 2004, 08:18 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,627 kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level)kiteless User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 4 Days 10 h 8 m 55 sec
Reputation Power: 53
Yes, you can do that with Javascript. I'm not much of a Javascript expert (we can't use it where I work due to the fact that it can be turned off), but you should be able to search the web for help. Basically you can write a function for onChange() that detects the current value with something like:

document.forms.myForm.mySelectBox.value;

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Manipulatin a Multiselectable list (adding, deleting, maintaining)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway