dru
07-22-2003, 02:39 PM
Hi,
In a form that i created, i allow the user to insert elements into a select list object. these things are lable/value pairs called label and value:
I use the following function to add these values from text boxes to the select list.
function addToList(listField, newText, newValue) {
if ( ( newValue == "" ) || ( newText == "" ) ) {
alert("You cannot add blank values!");
} else {
var len = listField.length++; // Increase the size of list and return the size
listField.options[len].value = newValue;
listField.options[len].text = newText;
listField.selectedIndex = len; // Highlight the one just entered (shows the user that it was entered)
form1.sublink_name.value = "";
form1.sublink_label.value = "";
} // Ends the check to see if the value entered on the form is empty
}
now i know that in order for this to work i need to select all the values in the select list when submitting it, which i do when submitting, so that the querysting has all the values. however, when i look at the querysting i only see the lables, no values. is there a trick to submitting also the values of the select list to the query string?
any help is appreciated
In a form that i created, i allow the user to insert elements into a select list object. these things are lable/value pairs called label and value:
I use the following function to add these values from text boxes to the select list.
function addToList(listField, newText, newValue) {
if ( ( newValue == "" ) || ( newText == "" ) ) {
alert("You cannot add blank values!");
} else {
var len = listField.length++; // Increase the size of list and return the size
listField.options[len].value = newValue;
listField.options[len].text = newText;
listField.selectedIndex = len; // Highlight the one just entered (shows the user that it was entered)
form1.sublink_name.value = "";
form1.sublink_label.value = "";
} // Ends the check to see if the value entered on the form is empty
}
now i know that in order for this to work i need to select all the values in the select list when submitting it, which i do when submitting, so that the querysting has all the values. however, when i look at the querysting i only see the lables, no values. is there a trick to submitting also the values of the select list to the query string?
any help is appreciated