ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
VeriSign Code Signing Digital Certificates provides assurance to end users. Read about this and more in the free white paper: “How to Digitally Sign Downloadable Code for Secure Content Transfer.” Learn More!
  #1  
Old February 5th, 2004, 04:26 PM
indratimilsina indratimilsina is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 7 indratimilsina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
populating dynamic editable list in the CF form

Hi There,

I need to create the list box in my cold fusion form which will generate dynamically populating list box, which can be editable.

Could any one please help me.

I have a table call ITEMS.

I make the query to select all the Item list in the form to input the data from the form to database, but I donot know how to make those list editable in the case if user want to input differnt value than the provided one by list.

Thanks in advance.
Indra.

Reply With Quote
  #2  
Old February 5th, 2004, 06:09 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,505 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 3 Days 20 h 19 m 19 sec
Reputation Power: 45
HTML List boxes are not editable. You'll need to create a text input field if you want the user to be able to enter something different.

Reply With Quote
  #3  
Old February 6th, 2004, 09:30 AM
indratimilsina indratimilsina is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 7 indratimilsina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Is there any programming language which I can used with cold fusion to make this work.

thanks.

Reply With Quote
  #4  
Old February 6th, 2004, 12:32 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,505 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 3 Days 20 h 19 m 19 sec
Reputation Power: 45
List boxes are never directly editable. However, you could use Javascript to let a user enter a value into a text input field, and use that text to update one of the list elements.

Reply With Quote
  #5  
Old February 6th, 2004, 03:52 PM
indratimilsina indratimilsina is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 7 indratimilsina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I will check this in weekend, but i need another information if you can give me some suggestion.

I have a table ITEMS WITH field (ItemNumber, Itemdescription, Itemcode and ItemRate)

I need to collect information for all above field from web form. There is dynamically populated list for all this in form but each one has to enter separetly. IS THERE ANY WAY " WHEN I SELECT ITMENUMBERR IN ITEMNUMBER FIELD ALL THE INPUT IN OTHER FIELD (LIKE ITEMDESCRIPTION, ITEMCODE AND ITEMRATE) AUTOMATICALLY INPUT THE VALUE RELATED WITH THAT ITEMNUMBER).

Thanks in advance.

Indra.

Reply With Quote
  #6  
Old February 6th, 2004, 06:03 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,505 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 3 Days 20 h 19 m 19 sec
Reputation Power: 45
You may benefit from checking out some books on HTML and forms, these questions really fall under that category. To answer your question, HTML only allows one value to be associated with a form element. So, no, there is no way to automatically do this.

Why not just pass the itemNumber as the value, and then on the target page execute a query to pull the rest of the data based on that item number?

As a workaround, you CAN pass all the fields together within the form's value, perhaps separated by the pipe symbol (|), and then on the target page parse apart the value to get back each element. But this is more complicated. I'd suggest just passing the ID.

Reply With Quote
  #7  
Old February 9th, 2004, 09:24 AM
indratimilsina indratimilsina is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 7 indratimilsina User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks. But I have bit different need. I need to put aroound 10-17 items at a time from form whose valuse are populated from the item table and displaying in form as a select box. and at the same time I need those select box as a editable one so that when end user need to input somethings different than what has been provided they can do that by editingthe list.

I do not thinks pasing the ID value and query base on that id will help me.

Thanks.

Reply With Quote
  #8  
Old June 21st, 2004, 01:11 PM
mkm mkm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 104 mkm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 51 m 53 sec
Reputation Power: 4
know no javascript

Hello,

We have a need to do exactly the same although having a text box that updates the listbox sounds just fine (as kiteless suggested). I am pretty much a ColdFusion newbie and I do not know a lick of Java. Could someone please tell me what I have to do to make this work?

Basically I have 4 or 5 dropdown list boxes on my form. I thought I'd create a textbox next to each list box where the user can enter in a value if they can't find it in the dropdown. Then they could click a button to update the dropdown to show what they entered.

There are other textboxes on the form however and it would be great if they didn't get reset when the user updated the listbox.

Is this possible? And how could I implement it? Sorry to sound like a complete moron but this is all very new to me.

Thanks in advance for any help,
mkm

Reply With Quote
  #9  
Old June 21st, 2004, 01:23 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,505 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 3 Days 20 h 19 m 19 sec
Reputation Power: 45
It's definitely possible. Try looking around at javascripts.com as there are loads of pre-made scripts there.
__________________
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
  #10  
Old June 21st, 2004, 03:19 PM
mkm mkm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 104 mkm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 51 m 53 sec
Reputation Power: 4
Hi, thanks for responding so quickly. I've spent over an hour searching that site and couldn't find anything. Do you know of any scripts off hand and how to use them? I've never used javascript before.

Thanks,
melissa

Reply With Quote
  #11  
Old June 21st, 2004, 03:57 PM
kiteless kiteless is offline
Moderator
Dev Shed Expert (3500 - 3999 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 3,505 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 3 Days 20 h 19 m 19 sec
Reputation Power: 45
Something like this would work on a basic level. But then you get into the problem of form option value vs. text. So, when the user adds something to the select box, you have to use the same text for both the new select option's value and text, which could introduce other complications.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Untitled</title>
<script language="JavaScript1.1">
function addToSelectBox() {
	var newLength = document.myForm.mySelectBox.length;
	document.myForm.mySelectBox[newLength] = document.createElement("option");
	document.myForm.mySelectBox[newLength].value = document.myForm.newText.value;
	document.myForm.mySelectBox[newLength].text=document.myForm.newText.value;
}
</script>
</head>

<body>
<form action="" method="post" name="myForm">
	<select name="mySelectBox" size="1">
		<option value="1" SELECTED>Option 1</option>
		<option value="2">Option 2</option>
		<option value="3">Option 3</option>
	</select>
	<br>
	<input type="text" name="newText" id="newText"> 
	<input type="button" name="addToSelectBoxButton" id="addToSelectBoxButton" value="Add to Select Box" onClick="addToSelectBox()">
	<br>
	<br>
	<input type="submit" value="Go">
</form>

</body>
</html>

Reply With Quote
  #12  
Old June 21st, 2004, 04:44 PM
mkm mkm is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 104 mkm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 h 51 m 53 sec
Reputation Power: 4
Hi, thanks for the script, I'll give it a shot.

Do you think it would better to have the user click a link to go to another form where they can input into a text box, click on a submit button which updates the table the listbox is populated with, and then when they return to the original form the new item shows up in the listbox?

Not sure if that would get around the problem or not (or even it that makes sense to anyone but me, lol).

Thanks again,
melissa

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > populating dynamic editable list in the CF form


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

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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