|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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. |
|
#2
|
|||
|
|||
|
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.
|
|
#3
|
|||
|
|||
|
Is there any programming language which I can used with cold fusion to make this work.
thanks. |
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
|||
|
|||
|
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. |
|
#6
|
|||
|
|||
|
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. |
|
#7
|
|||
|
|||
|
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. |
|
#8
|
|||
|
|||
|
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 ![]() |
|
#9
|
|||
|
|||
|
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 |
|
#10
|
|||
|
|||
|
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 |
|
#11
|
|||
|
|||
|
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>
|
|
#12
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > populating dynamic editable list in the CF form |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|