View Full Version : Urgent - Replacing existing item in dropdown list

05-15-2009, 06:46 PM
I'm looking for a script that does the following:

a user selects the item from drop-down, the list item is populated in a text box; then the user updates the text box and when clicks on update button which replaces the list item with updated value of text box.

Following is the script that adds to the list item - can I use the same script to update/replace list item?
<script language="JavaScript" type="text/javascript">
function move(fbox,tbox) {
var i = 0;
if(fbox.value != "") {
var no = new Option();
no.value = fbox.value;
no.text = fbox.value;
tbox.options[tbox.options.length] = no;
fbox.value = "";

I hope this makes sense. Any help is appreciated. Thanks.